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 #5 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
(In reply to dje from comment #3)
> suppose we ignore the flags field for all segments: what's the
> worst that could happen?

If you use non-matching build of an executable it may get incorrectly relocated
by some small displacement.  (*1)

People sometimes try to use non-matching build, IMO it cannot give meaningful
output but it may make their attempts even more difficult when the executable
gets "randomly" displaced.  Currently GDB does not display any notice it used
PIE displacement (and there is also no longer any notice it used PIC
displacement), unless one has "set verbose" (which nobody has).  This may make
a falsely-matched displacement a pain.

(*1) Currently the displacement still has to be PAGE_SIZE aligned, if it is not
PAGE_SIZE aligned no displacement gets used.  But I have TODOlisted I should
recheck the PAGE_SIZE requirement as it was removed for shlibs by
2da7921acc5c7b327b3619a95ca7ca36a0314dc4 and IMO it should be equally removed
for compatibility with prelinked/unprelinked PIE executables.

-- 
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]