RFC: Patch to fix MIPS -mno-shared with multi-got...
David Daney
ddaney@avtrex.com
Thu Mar 3 23:57:00 GMT 2005
Thiemo Seufer wrote:
> David Daney wrote:
> [snip]
>
>>>WRT possible breakge to things expecting the real "_gp": I agree that
>>>might be a problem. One possibility would be to define a new symbol,
>>>something like __gnu_local_gp, and make -mno-shared use that instead
>>>of plain _gp. -mno-shared is a new option, so there's no backwards
>>>compatiblity problem.
>>
>>OK, I kind of like this idea. But I am not an ABI authority. I am
>>assuming the the meaning of "_gp_disp" is defined somewhere in the ABI
>>specs. I know _gp is specified. Does anybody have objections to adding
>>the new magic __gnu_local_gp symbol?
>
>
> I have the general (and still vague) idea to have multigot-capable object
> files, with _gp _gp.1 .. _gp.n and _gp_disp _gp_disp.1 .. _gp_disp.n
> depending on the GOT in use, and with the single got case staying binary
> compatible. I think this would cover your case as well, but it's of
> course much more work.
>
Yes, it makes my head hurt just to think about it.
In lieu of doing that I present the attached patch.
The main question being: Use _gp or __gnu_local_gp ?
The pros of using _gp are that Thiemo's plan to magically rename _gp
would be binary compatible.
The pros of using __gnu_local_gp are that existing code using _gp
outside of .cpload would continue to work.
I am inclined to use _gp as it does not create a gnu specific ABI
extension, but I am apprehensive about what will happen when I try to
build glibc.
David Daney.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mno-shared-multi-got2.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20050303/661a4963/attachment.ksh>
More information about the Binutils
mailing list