[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gold/18859] New: Gold linker does not fully respect -no-as-needed
From: |
eugeni.stepanov at gmail dot com |
Subject: |
[Bug gold/18859] New: Gold linker does not fully respect -no-as-needed |
Date: |
Thu, 20 Aug 2015 20:53:31 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=18859
Bug ID: 18859
Summary: Gold linker does not fully respect -no-as-needed
Product: binutils
Version: 2.26 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: gold
Assignee: ccoutant at gmail dot com
Reporter: eugeni.stepanov at gmail dot com
CC: ian at airs dot com
Target Milestone: ---
Gold and ld behave differently when a shared library is first mentioned when
-as-needed is in effect, and then again after -no-as-needed. Ld generates a
DT_NEEDED entry for such library, and gold does not.
$ cat 1.c
int main() { return 0; }
# BFD linker
$ g++ 1.c -Wl,-as-needed -lutil -Wl,-no-as-needed -lutil -fuse-ld=bfd &&
readelf -d a.out | grep NEEDED
0x0000000000000001 (NEEDED) Shared library: [libutil.so.1]
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
# Gold linker
$ g++ 1.c -Wl,-as-needed -lutil -Wl,-no-as-needed -lutil -fuse-ld=gold &&
readelf -d a.out | grep NEEDED
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libm.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gold/18859] New: Gold linker does not fully respect -no-as-needed,
eugeni.stepanov at gmail dot com <=
- [Bug gold/18859] Gold linker does not fully respect -no-as-needed, ccoutant at gmail dot com, 2015/08/20
- [Bug gold/18859] Gold linker does not fully respect -no-as-needed, eugeni.stepanov at gmail dot com, 2015/08/20
- [Bug gold/18859] Gold linker does not fully respect -no-as-needed, ccoutant at gmail dot com, 2015/08/21
- [Bug gold/18859] Gold linker does not fully respect -no-as-needed, eugeni.stepanov at gmail dot com, 2015/08/24
- [Bug gold/18859] Gold linker does not fully respect -no-as-needed, cvs-commit at gcc dot gnu.org, 2015/08/25
- [Bug gold/18859] Gold linker does not fully respect -no-as-needed, ccoutant at gmail dot com, 2015/08/25