http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59410

--- Comment #16 from Kostya Serebryany <kcc at gcc dot gnu.org> ---
> Kernel is free to load PIE at ANY address it wants.  But
> you can specify where to load PIE via a linker switch
> 
> -Ttext-segment 0x855555000000
> 
> to tell kernel to load PIE to a specific address.

Hm. Interesting. What do I do wrong? 
% clang++ simple_race.cc -fsanitize=thread -Wl,-Ttext-segment=0x7d0000000000 ; 
(setarch x86_64 -R ./a.out )
FATAL: ThreadSanitizer can not mmap the shadow memory (something is mapped at
0x555555554000 < 0x7cf000000000)
FATAL: Make sure to compile with -fPIE and to link with -pie.

% clang++ simple_race.cc -fsanitize=thread ;  (setarch x86_64 -R ./a.out )
FATAL: ThreadSanitizer can not mmap the shadow memory (something is mapped at
0x555555554000 < 0x7cf000000000)
FATAL: Make sure to compile with -fPIE and to link with -pie.

% clang++ simple_race.cc -fsanitize=thread ;  ( ./a.out )
==================
WARNING: ThreadSanitizer: data race (pid=6559)

Reply via email to