[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/19393] New: --gc-sections fails to discard orphaned undefined
From: |
sourceware at mattwhitlock dot name |
Subject: |
[Bug gold/19393] New: --gc-sections fails to discard orphaned undefined dynamic symbols |
Date: |
Tue, 22 Dec 2015 09:59:06 +0000 |
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 <unistd.h>
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.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Bug gold/19393] New: --gc-sections fails to discard orphaned undefined dynamic symbols,
sourceware at mattwhitlock dot name <=