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] |
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.
bfd ChangeLog: 2005-03-04 David Daney <ddaney@avtrex.com>
* elfxx-mips.c (mips_elf_calculate_relocation): Handle special '__gnu_local_gp' symbol used by gas -mno-shared.
gas ChangeLog: 2005-03-04 David Daney <ddaney@avtrex.com>
* config/tc-mips.c (macro_build_lui): Use '__gnu_local_gp' instead of '_gp' for -mno-shared optimization. (s_cpload): Ditto. (s_abicalls): Document it in the comment. (md_show_usage): Document the -mno-shared option.
gas/testsuite ChangeLog: 2005-03-04 David Daney <ddaney@avtrex.com>
* gas/mips/elf-rel23b.d: Use '__gnu_local_gp' instead of '_gp' for -mno-shared optimization. * gas/mips/elf-rel25a.d: Ditto.
ld/testsuite ChangeLog: 2005-03-04 David Daney <ddaney@avtrex.com>
* ld-mips-elf/multi-got-no-shared{-1.s, -2.s, .d}: New test. * ld-mips-elf/mips-elf.exp: Run it.
Attachment:
binutils.d.bz2
Description: Unix tar archive
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |