Bug 300195 - read_elf_debug_info() should accept 'executable' .got sections
Summary: read_elf_debug_info() should accept 'executable' .got sections
Status: RESOLVED DUPLICATE of bug 296318
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: 3.7 SVN
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-17 12:22 UTC by hrkzmnm
Modified: 2012-07-13 13:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
ignore PF_X when choosing writable ELF sections (718 bytes, patch)
2012-05-17 12:22 UTC, hrkzmnm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description hrkzmnm 2012-05-17 12:22:12 UTC
Created attachment 71155 [details]
ignore PF_X when choosing writable ELF sections

Valgrind fails to resolve symbols on a PPC32 platform with old ABI, because:
 * read_elf_debug_info()  do not assume an ELF section which has 'X' flag as a valid section for GOT.
 * legacy PowerPC ABI had required GOT to be both writable and executable.
    #(http://sources.redhat.com/ml/binutils/2005-05/msg00391.html)

With attached patch, symbols seems to be successfully loaded on such environment (which uses 'bss-plt' layout instead of 'secure-plt').
Comment 1 Jiří Hruška 2012-07-13 13:47:53 UTC
296318 introduced changes in r12735 which, among other things, relax this requirement for strict R-X or RW- match exactly as the patch proposes, so it is no longer relevant.
   if (   map->rw
      && (phdr->p_flags & (PF_R | PF_W)) == (PF_R | PF_W)) {
      ...
      TRACE_SYMTAB("PT_LOAD[%ld]:   acquired as rw\n", i);
   }
   if (   map->rx
      && (phdr->p_flags & (PF_R | PF_X)) == (PF_R | PF_X)) {
      ...
      TRACE_SYMTAB("PT_LOAD[%ld]:   acquired as rx\n", i);
   }
Comment 2 Julian Seward 2012-07-13 13:56:30 UTC
Closing this a duplicate of 296318.  If you still have the problem in 
current svn trunk >= r12375, please re-open.

*** This bug has been marked as a duplicate of bug 296318 ***