This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
PIE question
- From: Daniel Jacobowitz <dan at codesourcery dot com>
- To: gdb at sourceware dot org
- Cc: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Date: Sat, 6 Mar 2010 19:53:29 -0500
- Subject: PIE question
Jan, could you explain a little how the situation in this comment can
happen?
static void
svr4_relocate_main_executable (void)
{
CORE_ADDR displacement = svr4_exec_displacement ();
/* Even if DISPLACEMENT is 0 still try to relocate it as this is a new
difference of in-memory vs. in-file addresses and we could already
relocate the executable at this function to improper address before. */
I came across this because our local ARM uClinux incorrectly links in
solib-svr4.c. The remote target sends qOffsets, uses the result to
relocate the objfile, and then this code overrides that. I'll fix
the target. But if there was any circumstance where a solib-svr4.c
target could also send qOffsets (I think some KGDB ports do this?)
then this will undo it.
I don't think this is related to our other discussion about executable
relocation; I haven't forgotten, I'll get back to you as soon as I can.
--
Daniel Jacobowitz
CodeSourcery