* coffread.c (coff_symtab_read): If we get the address from
authorJim Kingdon <jkingdon@engr.sgi.com>
Wed, 26 Oct 1994 21:50:19 +0000 (21:50 +0000)
committerJim Kingdon <jkingdon@engr.sgi.com>
Wed, 26 Oct 1994 21:50:19 +0000 (21:50 +0000)
target_lookup_symbol, set the section to -2 not SECT_OFF_BSS.
(coff_symtab_read): Set value and section of symbol that
process_coff_symbol returns.

gdb/ChangeLog
gdb/coffread.c

index a916c6cf46101e24f409060d3cfd63cc99871c08..1245a7add4d581c71efd579dff9daa6530ee9916 100644 (file)
@@ -1,3 +1,10 @@
+Wed Oct 26 12:20:53 1994  Jim Kingdon  <kingdon@cygnus.com>
+
+       * coffread.c (coff_symtab_read): If we get the address from
+       target_lookup_symbol, set the section to -2 not SECT_OFF_BSS.
+       (coff_symtab_read): Set value and section of symbol that
+       process_coff_symbol returns.
+
 Tue Oct 25 09:53:04 1994  J.T. Conklin  (jtc@phishhead.cygnus.com)
 
        * config/i386/tm-nbsd.h: Enable longjmp support.
index ddd05117bebcb0b507155f28d1a863353057209d..c4f06e14d23aeff1689122f5ff3ebe645be28c5f 100644 (file)
@@ -922,7 +922,10 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
                      break;
                    }
                  tmpaddr = reladdr;
-                 sec = SECT_OFF_BSS;
+                 /* The address has already been relocated; make sure that
+                    objfile_relocate doesn't relocate it again.  */
+                 sec = -2;
+                 ms_type = cs->c_sclass == C_STAT ? mst_file_bss : mst_bss;
                }
              else
                {
@@ -930,30 +933,47 @@ coff_symtab_read (symtab_offset, nsyms, section_offsets, objfile)
                  tmpaddr = cs->c_value;
                  if (cs->c_sclass != C_STAT)
                    tmpaddr += ANOFFSET (section_offsets, sec);
+
+                 switch (sec)
+                   {
+                   case SECT_OFF_TEXT:
+                   case SECT_OFF_RODATA:
+                     ms_type =
+                       cs->c_sclass == C_STAT ? mst_file_text : mst_text;
+                     break;
+                   case SECT_OFF_DATA:
+                     ms_type =
+                       cs->c_sclass == C_STAT ? mst_file_data : mst_data;
+                     break;
+                   case SECT_OFF_BSS:
+                     ms_type =
+                       cs->c_sclass == C_STAT ? mst_file_bss : mst_bss;
+                     break;
+                   default:
+                     ms_type = mst_unknown;
+                     break;
+                   }
                }
 
-             switch (sec)
+             if (cs->c_name[0] != '@' /* Skip tdesc symbols */)
+               prim_record_minimal_symbol_and_info
+                 (obsavestring (cs->c_name, strlen (cs->c_name),
+                                &objfile->symbol_obstack),
+                  tmpaddr,
+                  ms_type,
+                  NULL,
+                  sec,
+                  objfile);
+
+             if (SDB_TYPE (cs->c_type))
                {
-               case SECT_OFF_TEXT:
-               case SECT_OFF_RODATA:
-                 ms_type = cs->c_sclass == C_STAT ? mst_file_text : mst_text;
-                 break;
-               case SECT_OFF_DATA:
-                 ms_type = cs->c_sclass == C_STAT ? mst_file_data : mst_data;
-                 break;
-               case SECT_OFF_BSS:
-                 ms_type = cs->c_sclass == C_STAT ? mst_file_bss : mst_bss;
-                 break;
-               default:
-                 ms_type = mst_unknown;
-                 break;
+                 struct symbol *sym;
+                 sym = process_coff_symbol
+                   (cs, &main_aux, section_offsets, objfile);
+                 SYMBOL_VALUE (sym) = tmpaddr;
+                 SYMBOL_SECTION (sym) = sec;
                }
-
-             record_minimal_symbol (cs->c_name, tmpaddr, ms_type, objfile);
            }
-
-           if (SDB_TYPE (cs->c_type))
-             process_coff_symbol (cs, &main_aux, section_offsets, objfile);
            break;
 
          case C_FCN: