Undo dynamic symbol state after regular object sym type mismatch
Alan Modra
amodra@gmail.com
Sat Jul 15 12:14:00 GMT 2017
Hi Maciej,
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
That's fine.
> 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.
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list