summaryrefslogtreecommitdiff
path: root/coregrind/m_debuginfo/readelf.c
diff options
context:
space:
mode:
authortom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9>2007-11-21 16:09:18 +0000
committertom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9>2007-11-21 16:09:18 +0000
commitfc7773aa46d4909aa9bf7999cf4549c29e8b8b4e (patch)
tree851992c8be7553a7a8d57956f7ead0ada21c8379 /coregrind/m_debuginfo/readelf.c
parent9d3f9d784936ba5ef83cd63610262cab302c8b0e (diff)
Don't load debug sections from the linked debug file if we have
already loaded them from the main ELF file. Fixes #145609. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7196 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'coregrind/m_debuginfo/readelf.c')
-rw-r--r--coregrind/m_debuginfo/readelf.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/coregrind/m_debuginfo/readelf.c b/coregrind/m_debuginfo/readelf.c
index dfe9cf90..0dd7f063 100644
--- a/coregrind/m_debuginfo/readelf.c
+++ b/coregrind/m_debuginfo/readelf.c
@@ -1142,6 +1142,9 @@ Bool ML_(read_elf_debug_info) ( struct _SegInfo* si )
&& ehdr->e_shoff + ehdr->e_shnum*sizeof(ElfXX_Shdr) <= n_dimage)
{
Bool need_symtab = (NULL == symtab_img);
+ Bool need_stabs = (NULL == stab_img);
+ Bool need_dwarf2 = (NULL == debug_info_img);
+ Bool need_dwarf1 = (NULL == dwarf1d_img);
for (i = 0; i < ehdr->e_phnum; i++) {
ElfXX_Phdr *o_phdr = &((ElfXX_Phdr *)(dimage + ehdr->e_phoff))[i];
@@ -1186,14 +1189,14 @@ Bool ML_(read_elf_debug_info) ( struct _SegInfo* si )
/* ?? NAME SIZE IMAGE addr */
FIND(need_symtab, ".symtab", symtab_sz, symtab_img)
FIND(need_symtab, ".strtab", strtab_sz, strtab_img)
- FIND(1, ".stab", stab_sz, stab_img)
- FIND(1, ".stabstr", stabstr_sz, stabstr_img)
- FIND(1, ".debug_line", debug_line_sz, debug_line_img)
- FIND(1, ".debug_info", debug_info_sz, debug_info_img)
- FIND(1, ".debug_abbrev", debug_abbv_sz, debug_abbv_img)
- FIND(1, ".debug_str", debug_str_sz, debug_str_img)
- FIND(1, ".debug", dwarf1d_sz, dwarf1d_img)
- FIND(1, ".line", dwarf1l_sz, dwarf1l_img)
+ FIND(need_stabs, ".stab", stab_sz, stab_img)
+ FIND(need_stabs, ".stabstr", stabstr_sz, stabstr_img)
+ FIND(need_dwarf2, ".debug_line", debug_line_sz, debug_line_img)
+ FIND(need_dwarf2, ".debug_info", debug_info_sz, debug_info_img)
+ FIND(need_dwarf2, ".debug_abbrev", debug_abbv_sz, debug_abbv_img)
+ FIND(need_dwarf2, ".debug_str", debug_str_sz, debug_str_img)
+ FIND(need_dwarf1, ".debug", dwarf1d_sz, dwarf1d_img)
+ FIND(need_dwarf1, ".line", dwarf1l_sz, dwarf1l_img)
# undef FIND
}