[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/27441] Small inconsistency in between gold and bfd
From: |
matz at suse dot de |
Subject: |
[Bug ld/27441] Small inconsistency in between gold and bfd |
Date: |
Wed, 24 Feb 2021 13:54:29 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=27441
--- Comment #11 from Michael Matz <matz at suse dot de> ---
(In reply to Alan Modra from comment #8)
> (In reply to Michael Matz from comment #3)
> > % gcc -fPIC -Wl,--as-needed -fno-lto -shared -o good.so bad4.c -L. -l2 -l1
> > % readelf-dW good.so | grep lib
> > 0x0000000000000001 (NEEDED) Shared library: [lib2.so]
> > 0x0000000000000001 (NEEDED) Shared library: [lib1.so]
>
> I'd actually like to fix the above to *not* have DT_NEEDED lib2.so. The
> reason is that as-needed was supposed to be modeled on the way archive
> entries are treated, and if you were using static libraries you'd find the
> weak func1 in lib2.a would not be enough to cause lib2.o to be extracted..
Yes, I thought so as well, until I read ELF.txt again :) :
* When the link editor searches archive libraries, it extracts archive
members that contain definitions of undefined global symbols. The
member's definition may be either a global or a weak symbol. The
link editor does not extract archive members to resolve undefined
weak symbols. Unresolved weak symbols have a zero value.
"may be either a global or a weak symbol". It's weak undefs that don't cause
things to be pulled in, but a strong ref should pull in a weak def.
Independend of that I considered the current (non-LTO) behaviour more useful.
> Unfortunately I can't do that, libm.so.6 for instance is full of weak
> dynamic symbols.
(huh, I never noticed that; indeed)
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gold/27441] Small inconsistency in between gold and bfd, (continued)
- [Bug gold/27441] Small inconsistency in between gold and bfd, amodra at gmail dot com, 2021/02/19
- [Bug gold/27441] Small inconsistency in between gold and bfd, matz at suse dot de, 2021/02/23
- [Bug ld/27441] Small inconsistency in between gold and bfd, matz at suse dot de, 2021/02/23
- [Bug ld/27441] Small inconsistency in between gold and bfd, matz at suse dot de, 2021/02/23
- [Bug ld/27441] Small inconsistency in between gold and bfd, mliska at suse dot cz, 2021/02/23
- [Bug ld/27441] Small inconsistency in between gold and bfd, matz at suse dot de, 2021/02/23
- [Bug ld/27441] Small inconsistency in between gold and bfd, hjl.tools at gmail dot com, 2021/02/23
- [Bug ld/27441] Small inconsistency in between gold and bfd, amodra at gmail dot com, 2021/02/24
- [Bug ld/27441] Small inconsistency in between gold and bfd, rguenth at gcc dot gnu.org, 2021/02/24
- [Bug ld/27441] Small inconsistency in between gold and bfd, amodra at gmail dot com, 2021/02/24
- [Bug ld/27441] Small inconsistency in between gold and bfd,
matz at suse dot de <=
- [Bug ld/27441] Small inconsistency in between gold and bfd, amodra at gmail dot com, 2021/02/24
- [Bug ld/27441] Small inconsistency in between gold and bfd, cvs-commit at gcc dot gnu.org, 2021/02/24
- [Bug ld/27441] Small inconsistency in between gold and bfd, cvs-commit at gcc dot gnu.org, 2021/02/26
- [Bug ld/27441] Small inconsistency in between gold and bfd, cvs-commit at gcc dot gnu.org, 2021/02/28