[PATCH] BFD: Prevent writing the MIPS _gp_disp symbol into symbol tables
Maciej W. Rozycki
macro@mips.com
Tue Feb 6 20:37:00 GMT 2018
Hi Simon,
Thank you for your submission. Before I actually have a look at your
implementation I have a couple of questions about the problem you have
reported.
> The _gp_disp is a magic symbol, always implicitly defined by the linker.
> It does not make a sense to write it into symbol tables for output files.
> Moreover, now if the linker gets a version script, the _gp_disp symbol
> gets zero version definition index. This symbol is global while the zero
> index means unversioned local symbol. That confuses some tools like for
> example the LLD linker when they get such files as inputs.
Hmm, LLD being confused may well be a bug in that program.
The thing is we have been doing this since forever and there were no
issues so far, so obviously anything you observe must be a corner case.
E.g. I've had a quick look at a shared library I built back in 2001 and it
does have `_gp_disp' in its dynamic symbol table, as an absolute symbol
set to the canonical gp value. And it is no different with binaries built
nowadays. So before we move forward, can you please post an actual test
case which reproduces the problem?
Also this is your first submission to binutils and it is substantial
enough for you to have a copyright assignment or a similar arrangement in
place with FSF before it can be accepted for inclusion. Do you have one
already? Please let me know if you need further guidance with that and I
will help you.
Please ask if you have any questions.
Maciej
More information about the Binutils
mailing list