This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: PATCH: PR ld/5789: Linker doesn't check weak and hidden symbols
- From: Daniel Jacobowitz <drow at false dot org>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 23 Feb 2008 20:28:34 -0500
- Subject: Re: PATCH: PR ld/5789: Linker doesn't check weak and hidden symbols
- References: <20080224001111.GA5967@lucon.org>
On Sat, Feb 23, 2008 at 04:11:11PM -0800, H.J. Lu wrote:
> Hidden symbol must be defined locally. A weak symbol may not
> be defined locally. A weak hidden symbol isn't a problem for
> normal executable since linker can resolve it to 0. But for shared
> library and PIE, it isn't easy to make sure that a weak hidden
> symbol wil be 0 at run-time. It doesn't make senses to have a
> weak hidden symbol in shared library and PIE. This patch checks
> for it. If it is OK, I will update linker testsuite.
Why doesn't it make sense? If it is defined in the library, it should
be nonzero. If it is not defined _in the library_, it should resolve
to zero at link time.
--
Daniel Jacobowitz
CodeSourcery