bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/23591] undefined reference to `__start___sancov_cntrs' when buil


From: hjl.tools at gmail dot com
Subject: [Bug ld/23591] undefined reference to `__start___sancov_cntrs' when building with clang + asan + fuzzing + ld.bfd
Date: Thu, 30 Aug 2018 15:50:52 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=23591

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
                 CC|                            |hjl.tools at gmail dot com
            Version|unspecified                 |2.32 (HEAD)
   Target Milestone|---                         |2.32

--- Comment #5 from H.J. Lu <hjl.tools at gmail dot com> ---
address@hidden pr23591]$ cat foo.S
        .section        __sancov_cntrs,"aG",%progbits,foo1,comdat
        .long 0
        .section .text,"axG",%progbits,foo1,comdat
        .globl foo1
        .type foo1, @function
foo1:
        .long 0
        .section        __sancov_cntrs,"aG",%progbits,foo2,comdat
        .long 1
        .section .text,"axG",%progbits,foo2,comdat
        .globl foo2
        .type foo2, @function
foo2:
        .long 1
address@hidden pr23591]$ cat foo-auto.S 
        .section .text,"axG",%progbits,foo1,comdat
        .globl foo1
        .type foo1, @function
foo1:
        .byte 0
address@hidden pr23591]$ cat x.c 
extern int __start___sancov_cntrs;

int
bar (void)
{
   int* ap = &__start___sancov_cntrs;
   return ap[0];
}
address@hidden pr23591]$ cat y.S 
        .hidden __start___sancov_cntrs
address@hidden pr23591]$ make
gcc -B../ -fPIC -O2 -g   -c -o x.o x.c
gcc -B../ -fPIC -O2 -g -c -o y.o y.S
gcc -B../ -fPIC -O2 -g -c -o foo-auto.o foo-auto.S
gcc -B../ -fPIC -O2 -g -c -o foo.o foo.S
./ld -shared  -o x.so x.o y.o foo-auto.o foo.o
./ld: x.o: in function `bar':
/export/home/hjl/bugs/binutils/pr23591/x.c:7: undefined reference to
`__start___sancov_cntrs'
make: *** [Makefile:12: x.so] Error 1
address@hidden pr23591]$ make LD=ld.gold
ld.gold -shared  -o x.so x.o y.o foo-auto.o foo.o
address@hidden pr23591]$

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]