ASAN and $ORIGIN

Alexander Monakov amonakov@ispras.ru
Fri Mar 10 16:13:00 GMT 2017


On Fri, 10 Mar 2017, Michael Thayer wrote:
> $ gcc test.c -o test -ldl -Wl,-rpath,'$ORIGIN'
> $ ./test
> True
> $ gcc test.c -o test -ldl -Wl,-rpath,'$ORIGIN' -fsanitize=address
> $ ./test

This seems unexpected, but you can investigate it a bit more on your end: add
'-v' to gcc command line to see how linker flags differ, run 'readelf -d' on
./test to check how rpath flag changes, or run 'LD_DEBUG=libs ./test' to see
how dynamic lookup decisions are made.

HTH.
Alexander



More information about the Gcc-help mailing list