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

Joerg Sonnenberger joerg at britannica.bec.de
Mon Mar 26 08:12:27 PDT 2012


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.

Joerg



More information about the llvm-commits mailing list