Fix problems introduced with my last change.
[deliverable/binutils-gdb.git] / gdb / elfread.c
index e76d5cda7fffdb4f7746402efb3b28a573a2de13..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 (objfile);
+      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 (objfile);
-      break;
     case mst_bss:
     case mst_file_bss:
-      section = SECT_OFF_BSS (objfile);
+      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 (objfile));
+
       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))
This page took 0.023671 seconds and 4 git commands to generate.