Fix problems introduced with my last change.
[deliverable/binutils-gdb.git] / gdb / elfread.c
index d63d16a30fabea9f6a1d7bc0c68064348731fc0a..60f7988029b03ea3aa1c5494d9df21eb8998d3c8 100644 (file)
@@ -191,18 +191,16 @@ record_minimal_symbol_and_info (name, address, ms_type, info, bfd_section,
     {
     case mst_text:
     case mst_file_text:
-      section = SECT_OFF_TEXT;
+      section = bfd_section->index;
 #ifdef SMASH_TEXT_ADDRESS
       SMASH_TEXT_ADDRESS (address);
 #endif
       break;
     case mst_data:
     case mst_file_data:
-      section = SECT_OFF_DATA;
-      break;
     case mst_bss:
     case mst_file_bss:
-      section = SECT_OFF_BSS;
+      section = bfd_section->index;
       break;
     default:
       section = -1;
@@ -293,8 +291,7 @@ elf_symtab_read (objfile, dynamic)
       if (number_of_symbols < 0)
        error ("Can't read symbols from %s: %s", bfd_get_filename (objfile->obfd),
               bfd_errmsg (bfd_get_error ()));
-      /* FIXME: Should use section specific offset, not SECT_OFF_TEXT. */
-      offset = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT);
+
       for (i = 0; i < number_of_symbols; i++)
        {
          sym = symbol_table[i];
@@ -305,6 +302,7 @@ elf_symtab_read (objfile, dynamic)
              continue;
            }
 
+          offset = ANOFFSET (objfile->section_offsets, sym->section->index);
          if (dynamic
              && sym->section == &bfd_und_section
              && (sym->flags & BSF_FUNCTION))
@@ -460,15 +458,15 @@ elf_symtab_read (objfile, dynamic)
                      index = SECT_OFF_MAX;
                      if (STREQ ("Bbss.bss", sym->name))
                        {
-                         index = SECT_OFF_BSS;
+                         index = SECT_OFF_BSS (objfile);
                        }
                      else if (STREQ ("Ddata.data", sym->name))
                        {
-                         index = SECT_OFF_DATA;
+                         index = SECT_OFF_DATA (objfile);
                        }
                      else if (STREQ ("Drodata.rodata", sym->name))
                        {
-                         index = SECT_OFF_RODATA;
+                         index = SECT_OFF_RODATA (objfile);
                        }
                      if (index != SECT_OFF_MAX)
                        {
This page took 0.024567 seconds and 4 git commands to generate.