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

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


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