https://sourceware.org/bugzilla/show_bug.cgi?id=19393
Bug ID: 19393
Summary: --gc-sections fails to discard orphaned undefined
dynamic symbols
Product: binutils
Version: 2.25
Status: NEW
Severity: normal
Priority: P2
Component: gold
Assignee: ccoutant at gmail dot com
Reporter: sourceware at mattwhitlock dot name
CC: ian at airs dot com
Target Milestone: ---
When garbage collecting function sections, Gold fails to discard undefined
dynamic symbols that become unreferenced/orphaned as a result of the garbage
collection. The BFD linker does this correctly.
A very simple test case demonstrating the problem:
$ cat test.c
#include
void unused() {
close(0);
}
int main() {
return 0;
}
$ ld.gold --version | head -n1
GNU gold (Gentoo 2.25.1 p1.1 2.25.1) 1.11
$ gcc -ffunction-sections -Wl,--gc-sections,-fuse-ld=gold -o test test.c
$ nm test | fgrep -c close
1
$ ld.bfd --version | head -n1
GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
$ gcc -ffunction-sections -Wl,--gc-sections,-fuse-ld=bfd -o test test.c
$ nm test | fgrep -c close
0
--
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils