https://sourceware.org/bugzilla/show_bug.cgi?id=32950
Bug ID: 32950
Summary: --as-needed breaks linking
Product: binutils
Version: 2.43.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: ld
Assignee: unassigned at sourceware dot org
Reporter: stsp at users dot sourceforge.net
Target Milestone: ---
Created attachment 16077
--> https://sourceware.org/bugzilla/attachment.cgi?id=16077&action=edit
test case
Here is the fully automated
test-case, just run `make`:
cc -c -o a.o a.c
cc -Wall -shared libfoo.c -o libfoo.so
ld --as-needed -shared -L. -lfoo --no-undefined a.o -o liba.so
ld: a.o: in function `bar':
a.c:(.text+0x9): undefined reference to `foo'
make: *** [makefile:7: liba.so] Error 1
Running `make LD=ld.lld` works fine.
Removing --as-needed from makefile
also makes it to work.
--
You are receiving this mail because:
You are on the CC list for the bug.