summaryrefslogtreecommitdiff
path: root/gdb/elfread.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-05-05 19:09:27 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2000-05-05 19:09:27 +0000
commit3f0ab7794b862db6170e7b4eefcac8729528c564 (patch)
tree92d712013f90e7dc5fc76182215e67ee4ae4ca7f /gdb/elfread.c
parentd42d46b7edddeb277bf31693c00e6f9d129c2e3c (diff)
downloadgdb-3f0ab7794b862db6170e7b4eefcac8729528c564.tar.gz
2000-05-04 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
* elfread.c (elf_symtab_read): The calculation of 'offset' must be done for each symbol, not just once. The index used must be the index of the section where 'sym' resides, not .text.
Diffstat (limited to 'gdb/elfread.c')
-rw-r--r--gdb/elfread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/elfread.c b/gdb/elfread.c
index e76d5cda7ff..85b04ec7bbe 100644
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
@@ -293,8 +293,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 +304,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))