RFC: Patch to fix MIPS -mno-shared with multi-got...
Daniel Jacobowitz
drow@false.org
Fri Mar 4 00:43:00 GMT 2005
On Thu, Mar 03, 2005 at 03:57:04PM -0800, David Daney wrote:
> 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.
As David said, I think this solves a different problem.
> 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.
We can handle __gnu_local_gp.1 just as easily as _gp.1, once someone
does the work :-) I don't have much of a preference.
--
Daniel Jacobowitz
CodeSourcery, LLC
More information about the Binutils
mailing list