This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Patch to fix MIPS -mno-shared with multi-got...


David Daney <ddaney@avtrex.com> writes:
> 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.

Well, I think Thiemo was suggesting that the assembler use _gp.N
instead of _gp, so that would need a GNU-specific extension as well.

Other arguments in favour of __gnu_local_gp:

  - What -mno-shared does is already a GNU-specific ABI extension,
    in that no existing MIPS tools do it as far as I'm aware.  So in
    a way, it seems natural to use a GNU-specific extension for the
    symbol as well.

  - -mno-shared isn't implied by other options.  You have to ask for
    it explicitly.  It seems reasonable to ask that you only use
    -mno-shared with a linker that would support it.

  - Simply adding a "__gnu_local_gp = _gp;" assignment to a linker
    script would make it work with existing linkers.

FWIW, I like your patch (but I can't approve it).  One very minor
nit though:

> !   ex.X_add_symbol = symbol_find_or_make (in_shared ? "_gp_disp" : "__gnu_local_gp");

...watch the long lines.

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]