This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [committed] MIPS/BFD: Remove extraneous undefined weak symbol visibility check
- From: Alan Modra <amodra at gmail dot com>
- To: "Maciej W. Rozycki" <macro at mips dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, binutils at sourceware dot org
- Date: Fri, 6 Jul 2018 17:18:54 +0930
- Subject: Re: [committed] MIPS/BFD: Remove extraneous undefined weak symbol visibility check
- References: <20171012131007.27554-1-hjl.tools@gmail.com> <20171012131007.27554-6-hjl.tools@gmail.com> <alpine.DEB.2.00.1710182018020.3886@tp.orcam.me.uk> <alpine.DEB.2.00.1806282100020.20622@tp.orcam.me.uk>
On Fri, Jun 29, 2018 at 03:48:08PM +0100, Maciej W. Rozycki wrote:
> I got to this finally, in the course of resolving PR ld/21805. The MIPS
> backend currently ignores `-z dynamic-undefined-weak' and its complement,
> however this can change once PR ld/21805 has been fixed. But what is the
> intended interaction between this option and `--export-dynamic' (and its
> complement)? Should one override the other or ignore it?
>
> But only exporting undefined weaks makes no sense to me. So I'm tempted
> to make the MIPS backend only export undefined weaks if `--export-dynamic'
> and `-z dynamic-undefined-weak' are active both at once, even though it
> looks to me like with all the other backends the options ignore each
> other.
-z dynamic-undefined-weak should make undefined weak symbol behave
just like strong undefined symbols, which are made dynamic independent
of --export-dynamic. --export-dynamic affects defined symbols.
> Also I still do not understand the matter of PR ld/22269, that is why
> exporting undefined weaks in PIE (static or dynamic) would cause a
> non-zero run-time value? They'll still be undefined weaks at load time
> after all (unless, in the dynamic case, satisfied by a DSO), so the
> original value of zero is supposed to stay, and if it is not the case,
> then it looks to me like a run-time loader bug rather than a static linker
> one.
Yes, dynamic undefined weaks should remain zero if no definition is
found at run time. -z nodynamic-undefined-weak is supposed to ensure
they remain zero when no definition was found at link time even if a
definition is found at run time.
--
Alan Modra
Australia Development Lab, IBM