I'm here with a somewhat strange question.
Is there a way to exec
a program and specify the VirtualAddress that it should be loaded at?
Example:
a.out
is a PIE, with entry point 0x460
.
b.out
fork
& exec
's a.out
, but tells it, "Hey, I want to you load the .text
section at 0x200000
, so the entry point is 0x200460
".
I looked at the POSIX exec
function family, ld.so
, and ld-linux.so.2
, but didn't see anything that would let be do this.
My immediate solution is to write my own linker, but if there's something that will let me do this already, that would make my life a lot easier.
Thanks!