From b8d39351ea5eabfa364474f006b1556f40f0f636 Mon Sep 17 00:00:00 2001 From: Elena Zannoni Date: Fri, 5 May 2000 19:09:27 +0000 Subject: [PATCH] 2000-05-04 Elena Zannoni * 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. --- gdb/ChangeLog | 9 ++++++++- gdb/elfread.c | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6ba978721c0..987431d67cd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2000-05-05 Elena Zannoni + + * 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. + 2000-05-05 Michael Snyder * procfs.c (many functions): change int cmd; to long cmd; @@ -19,7 +26,7 @@ and missing return when handling an ordinary signal from the inferior. -Elena Zannoni +2000-05-04 Elena Zannoni * objfiles.h (SECT_OFF_DATA, SECT_OFF_TEXT, SECT_OFF_BSS, SECT_OFF_RODATA): Define as functions of OBJFILE. Add 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)) -- 2.30.2