This is the mail archive of the
mailing list for the binutils project.
Re: Undo dynamic symbol state after regular object sym type mismatch
- From: Alan Modra <amodra at gmail dot com>
- To: "Maciej W. Rozycki" <macro at imgtec dot com>
- Cc: binutils at sourceware dot org
- Date: Sat, 15 Jul 2017 21:43:56 +0930
- Subject: Re: Undo dynamic symbol state after regular object sym type mismatch
- Authentication-results: sourceware.org; auth=none
- References: <20170417140540.GX24006@bubble.grove.modra.org> <alpine.DEB.firstname.lastname@example.org>
On Tue, Jul 11, 2017 at 02:01:31AM +0100, Maciej W. Rozycki wrote:
> In an attempt to prevent new MIPS target failures in preparation for the
> 2.29 release I have now looked into it and what the MIPS backend produces
> looks correct to me according to the MIPS psABI.
> Specifically, while linking the `indirect5a' executable, in the
> `indirect5a.o' object supplied we have a locally-defined global `bar'
> symbol referred to -- in the case of the o32 ABI -- with an R_MIPS_GOT16
> relocation, which is absolutely fine for a MIPS SVR4 psABI executable.
> In response the MIPS backend creates the mandatory global GOT entry and
> its corresponding dynsym entry for `bar'.
But in my opinion this is a bug. A symbol in an executable shouldn't
be made dynamic unless it is referenced by a dynamic object, or by
--export-dynamic or other similar options. Since "bar" in the
executable is a variable and "bar" in the dynamic library a function,
the dynamic library can't be referencing the executable "bar". The
executable GOT entry for "bar" will need a dynamic relocation in a
PIE, but that can be a relative relocation not needing a symbol.
Australia Development Lab, IBM