This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: Revised fix for gold problem with weak undefined symbols
- From: Daniel Jacobowitz <drow at false dot org>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Wed, 16 Apr 2008 18:38:02 -0400
- Subject: Re: PATCH: Revised fix for gold problem with weak undefined symbols
- References: <c17be2b30804161411q5ee68cecy215c5646d276a709@mail.gmail.com>
On Wed, Apr 16, 2008 at 02:11:14PM -0700, Cary Coutant wrote:
> This patch brings gold into better agreement with gnu ld in its
> handling of weak undefined symbols. It turns out that for non-PIC code
> in a shared library, gnu ld would emit a dynamic relocation so that a
> weak undef would be resolved dynamically; gnu ld appears to statically
> resolve weak undefs to zero only when linking an executable. I've
> added several additional test cases and verified that gold's behavior
> matches gnu ld's behavior in each case.
FWIW, I have been looking at this issue in several ports over the last
week. I think the actual answer is that GNU ld's organization makes
it very hard to handle weak undefs consistently, and each port's
behavior is different.
That's one thing in favor of gold's compiler-based testing.
--
Daniel Jacobowitz
CodeSourcery