This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/11786] PIE support may not work for some PIEs


https://sourceware.org/bugzilla/show_bug.cgi?id=11786

--- Comment #10 from dje at google dot com ---
(In reply to Paul Pluzhnikov from comment #7)
> Would it be reasonable to check NT_GNU_BUILD_ID, and skip the Phdr check
> entirely on a match?
> 
> (In reply to Jan Kratochvil from comment #6)
> > Differently than... bfd ld?  gold vs. ld executables are a different build
> > which cannot match / is not guaranteed to match.
> 
> The flow here (Google b/10274851) is:
> 
>   (gold-linked, PIE) unstripped -> "strip -g" -> stripped -> core
> 
>   gdb stripped core    # works, but no debug info :-(
>   gdb unstripped core  # fails to relocate the binary :-(
> 
> Gold and strip do not agree on p_flags and p_align of GNU_RELRO,
> but the "unstripped" and "stripped" *are* exact match.

What if the core file doesn't have NT_GNU_BUILD_ID?
E.g., what if the program headers in the core file (obtained via auxv search,
ref: gdb/solib-svr4.c:read_program_header) refer to addresses only in the
executable?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]