[LLVMdev] [PATCH] Add the disable_aslr option that will disable the address space layout randomization under AddressSanitizer on 10.6

Alexander Potapenko glider at google.com
Fri Dec 9 11:46:37 PST 2011


> Link time is of course better.
> But if there is a syscall (like the one used by setarch) we could call it
> and reexec.
> Using setenv("DYLD_NO_PIE")+reexec looks gross to me.
There's posix_spawnattr_setflags() that can do the job
(http://reverse.put.as/2011/08/11/how-gdb-disables-aslr-in-mac-os-x-lion/),
but the necessary flag appeared only in Lion.

To the best of my knowledge, there's no link-time option that disables
ASLR but keeps PIE on Snow Leopard or Lion.
At the moment we're using DYLD_NO_PIE with Chromium binaries to
disable ASLR at runtime.



More information about the llvm-dev mailing list