ASAN and $ORIGIN

Michael Thayer michael.thayer@oracle.com
Fri Mar 10 16:03:00 GMT 2017


Hello,

I have been having problems with the combination of ASAN and DT_RPATH 
with $ORIGIN.  Before reporting it as a bug, I wanted to ask if the 
following is expected for some reason I missed.

Thanks!
Regards
Michael

$ cat test.c
#include <stdio.h>
#include <dlfcn.h>

int main(int argc, char **argv)
{
     if (dlopen("test.so", RTLD_LAZY))
         printf("True\n");
     return 0;
}
$ gcc test.c -o test -ldl -Wl,-rpath,'$ORIGIN'
$ ./test
True
$ gcc test.c -o test -ldl -Wl,-rpath,'$ORIGIN' -fsanitize=address
$ ./test
$
-- 
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister 
der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher



More information about the Gcc-help mailing list