* strerror.c: Revert last change. Declare static sys_nerr
[deliverable/binutils-gdb.git] / gdb / dbxread.c
index 57201307066ef83895b606f9a7345fbbf7707823..ba1d2b626b9de56123f0d4b72a37d30aa7f0b8be 100644 (file)
@@ -352,8 +352,8 @@ add_this_object_header_file (int i)
 static void
 add_old_header_file (char *name, int instance)
 {
-  register struct header_file *p = HEADER_FILES (current_objfile);
-  register int i;
+  struct header_file *p = HEADER_FILES (current_objfile);
+  int i;
 
   for (i = 0; i < N_HEADER_FILES (current_objfile); i++)
     if (STREQ (p[i].name, name) && instance == p[i].instance)
@@ -378,8 +378,8 @@ add_old_header_file (char *name, int instance)
 static void
 add_new_header_file (char *name, int instance)
 {
-  register int i;
-  register struct header_file *hfile;
+  int i;
+  struct header_file *hfile;
 
   /* Make sure there is room for one more header file.  */
 
@@ -421,7 +421,7 @@ add_new_header_file (char *name, int instance)
 static struct type **
 explicit_lookup_type (int real_filenum, int index)
 {
-  register struct header_file *f = &HEADER_FILES (current_objfile)[real_filenum];
+  struct header_file *f = &HEADER_FILES (current_objfile)[real_filenum];
 
   if (index >= f->length)
     {
@@ -752,8 +752,8 @@ dbx_symfile_finish (struct objfile *objfile)
     {
       if (HEADER_FILES (objfile) != NULL)
        {
-         register int i = N_HEADER_FILES (objfile);
-         register struct header_file *hfiles = HEADER_FILES (objfile);
+         int i = N_HEADER_FILES (objfile);
+         struct header_file *hfiles = HEADER_FILES (objfile);
 
          while (--i >= 0)
            {
@@ -1292,12 +1292,12 @@ function_outside_compilation_unit_complaint (const char *arg1)
 static void
 read_dbx_symtab (struct objfile *objfile)
 {
-  register struct external_nlist *bufp = 0;    /* =0 avoids gcc -Wall glitch */
+  struct external_nlist *bufp = 0;     /* =0 avoids gcc -Wall glitch */
   struct internal_nlist nlist;
   CORE_ADDR text_addr;
   int text_size;
 
-  register char *namestring;
+  char *namestring;
   int nsl;
   int past_first_source_file = 0;
   CORE_ADDR last_o_file_start = 0;
@@ -1380,7 +1380,14 @@ read_dbx_symtab (struct objfile *objfile)
   data_sect_index = objfile->sect_index_data;
   if (data_sect_index == -1)
     data_sect_index = SECT_OFF_BSS (objfile);
-  gdb_assert (data_sect_index != -1);
+  if (data_sect_index == -1)
+    data_sect_index = SECT_OFF_RODATA (objfile);
+
+  /* If data_sect_index is still -1, that's okay.  It's perfectly fine
+     for the file to have no .data, no .bss, and no .text at all, if
+     it also has no global or static variables.  If it does, we will
+     get an internal error from an ANOFFSET macro below when we try to
+     use data_sect_index.  */
 
   for (symnum = 0; symnum < DBX_SYMCOUNT (objfile); symnum++)
     {
@@ -1708,7 +1715,7 @@ read_dbx_symtab (struct objfile *objfile)
            if (pst && STREQ (namestring, pst->filename))
            continue;
            {
-             register int i;
+             int i;
              for (i = 0; i < includes_used; i++)
                if (STREQ (namestring, psymtab_include_list[i]))
                  {
@@ -2581,12 +2588,12 @@ dbx_psymtab_to_symtab (struct partial_symtab *pst)
 static void
 read_ofile_symtab (struct partial_symtab *pst)
 {
-  register char *namestring;
-  register struct external_nlist *bufp;
+  char *namestring;
+  struct external_nlist *bufp;
   struct internal_nlist nlist;
   unsigned char type;
   unsigned max_symnum;
-  register bfd *abfd;
+  bfd *abfd;
   struct objfile *objfile;
   int sym_offset;              /* Offset to start of symbols to read */
   int sym_size;                        /* Size of symbols to read */
@@ -2798,7 +2805,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, char *name,
   static CORE_ADDR last_pc_address;
 #endif
 
-  register struct context_stack *new;
+  struct context_stack *new;
   /* This remembers the address of the start of a function.  It is used
      because in Solaris 2, N_LBRAC, N_RBRAC, and N_SLINE entries are
      relative to the current function's start address.  On systems
This page took 0.02479 seconds and 4 git commands to generate.