bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/26590] New: --as-needed doesn't work correctly


From: hjl.tools at gmail dot com
Subject: [Bug ld/26590] New: --as-needed doesn't work correctly
Date: Wed, 09 Sep 2020 13:40:11 +0000

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

            Bug ID: 26590
           Summary: --as-needed doesn't work correctly
           Product: binutils
           Version: 2.36 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: hjl.tools at gmail dot com
                CC: amodra at gmail dot com
  Target Milestone: ---

Created attachment 12829
  --> https://sourceware.org/bugzilla/attachment.cgi?id=12829&action=edit
A testcase

[hjl@gnu-cfl-2 pr26530a]$ make
gcc -B./ -O2 -g -c -o lto-18a.o lto-18a.c
gcc -B./ -O2 -g -c -o lto-18d.o lto-18d.c
gcc -B./ -O2 -g -fPIC -c -o lto-18b.o lto-18b.c
./ld -shared -o liblto-18b.so lto-18b.o
gcc -B./ -O2 -g -fPIC -c -o lto-18c.o lto-18c.c
./ld -shared -o liblto-18c.so lto-18c.o
gcc -B./ -Wl,--as-needed -o x lto-18a.o lto-18d.o liblto-18b.so liblto-18c.so
-Wl,-R,.
./ld: liblto-18c.so: undefined reference to `f1'
collect2: error: ld returned 1 exit status
make: *** [Makefile:23: x] Error 1
[hjl@gnu-cfl-2 pr26530a]$ gcc -B./ -Wl,--as-needed -o x lto-18a.o lto-18d.o
liblto-18b.so liblto-18c.so -Wl,-R,. -fuse-ld=gold
[hjl@gnu-cfl-2 pr26530a]$ ./x
1
[hjl@gnu-cfl-2 pr26530a]$

-- 
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]