|
From: <sv...@va...> - 2007-11-21 16:09:18
|
Author: tom
Date: 2007-11-21 16:09:18 +0000 (Wed, 21 Nov 2007)
New Revision: 7196
Log:
Don't load debug sections from the linked debug file if we have
already loaded them from the main ELF file. Fixes #145609.
Modified:
trunk/coregrind/m_debuginfo/readelf.c
Modified: trunk/coregrind/m_debuginfo/readelf.c
===================================================================
--- trunk/coregrind/m_debuginfo/readelf.c 2007-11-20 23:41:23 UTC (rev 7195)
+++ trunk/coregrind/m_debuginfo/readelf.c 2007-11-21 16:09:18 UTC (rev 7196)
@@ -1142,6 +1142,9 @@
&& 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 @@
/* ?? 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
}
|
|
From: Nicholas N. <nj...@cs...> - 2007-11-21 21:17:54
|
On Wed, 21 Nov 2007 sv...@va... wrote: > Log: > Don't load debug sections from the linked debug file if we have > already loaded them from the main ELF file. Fixes #145609. Could you add a comment to that code briefly explaining the bug outcome, or perhaps a reference to the bug? N |