This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR ld/5789: Linker doesn't check weak and hidden symbols


On Sat, Feb 23, 2008 at 5:28 PM, Daniel Jacobowitz <drow@false.org> wrote:
> 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.
>

It isn't easy to resolve it to 0 at link-time for shared library since the
load address of shared library isn't fixed. For x86, I will need to edit
addressing mode of instructions. I don't know how reliable it will be.

H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]