[llvm-commits] [compiler-rt] r153431 - /compiler-rt/trunk/lib/asan/asan_linux.cc

Evgeniy Stepanov eugeni.stepanov at gmail.com
Mon Mar 26 08:31:52 PDT 2012


On Mon, Mar 26, 2012 at 7:12 PM, Joerg Sonnenberger
<joerg at britannica.bec.de> wrote:
> On Mon, Mar 26, 2012 at 09:48:41AM -0000, Evgeniy Stepanov wrote:
>> Modified: compiler-rt/trunk/lib/asan/asan_linux.cc
>> URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_linux.cc?rev=153431&r1=153430&r2=153431&view=diff
>> ==============================================================================
>> --- compiler-rt/trunk/lib/asan/asan_linux.cc (original)
>> +++ compiler-rt/trunk/lib/asan/asan_linux.cc Mon Mar 26 04:48:41 2012
>> @@ -25,7 +25,6 @@
>>  #include <sys/syscall.h>
>>  #include <sys/types.h>
>>  #include <fcntl.h>
>> -#include <link.h>
>>  #include <pthread.h>
>>  #include <stdio.h>
>>  #include <unistd.h>
>> @@ -36,6 +35,8 @@
>>  #include <sys/ucontext.h>
>>  #endif
>>
>> +extern "C" void* _DYNAMIC;
>> +
>>  namespace __asan {
>>
>>  void *AsanDoesNotSupportStaticLinkage() {
>>
>>
>
> This is wrong, it forces an UNDEF reference. You really want to use
>
> static int my_DYNAMIC __attribute__((__weakref__(_DYNAMIC)));
>
> or so if it is supposed to work for static linked binaries.

That's the point, we don't want it to work for static binaries. That's
why the function is called AsanDoesNotSupportStaticLinkage.

>
> Joerg
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list