This is the mail archive of the gdb-patches@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]

Re: [patch] Relocate phdr in read_program_header


ping?



On 11-09-30 03:31 PM, Aleksandar Ristovski wrote:
Hello,

When attaching to a process without the executable file, gdb reads
pheaders from the target (solib-svr4.c: read_program_header).

However, it does not take into account possibility of having PIE
executable on the other end, resulting in trying to read from
unrelocated phdr address.

This patch addresses the issue by looking for PT_PHDR; if found, uses it
to determine relocation and adjusts address before reading it from
target memory.

Testsuite on x86_64-unknown-linux-gnu did not show any regressions.


Thanks,



Aleksandar Ristovski QNX Software Systems



... Aleksandar Ristovski <aristovski@qnx.com>

* solib-svr4.c (read_program_header): If PT_PHDR is present, use it
to calculate correct address in case of PIE.




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