canistation / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

Link libasan with -z interpose on Linux #393

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've noticed that libasan.so gets linked with -z global on Android to avoid 
need for LD_PRELOAD. BDF linker has a flag called -z interpose which has 
similar purpose. I suggest to use it to make ASan DSO on Linux more 
user-friendly. While at it, we can also use -z nodlopen to prohibit dlopening 
libasan.so.

Original issue reported on code.google.com by tetra20...@gmail.com on 10 Jun 2015 at 2:53

GoogleCodeExporter commented 9 years ago
Interesting. So -z interpose has the same effect as moving libasan.so to the 
beginning of the DT_NEEDED list? This certainly would not hurt (unless it 
breaks the build with some older version linker, CentOS in particular comes to 
mind).
-z nodlopen also sounds like a good idea.

Original comment by euge...@google.com on 10 Jun 2015 at 11:24

GoogleCodeExporter commented 9 years ago
Oh, nice Ulrich rejected -z interpose for Glibc back in 2003: 
https://sourceware.org/ml/libc-alpha/2003-05/msg00305.html

Nodlopen seems to be supported though.

Original comment by tetra20...@gmail.com on 11 Jun 2015 at 8:05

GoogleCodeExporter commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Original comment by ramosian.glider@gmail.com on 30 Jul 2015 at 9:06