diff options
author | Thiemo Seufer <ths@networkno.de> | 2005-03-05 00:01:44 +0000 |
---|---|---|
committer | Thiemo Seufer <ths@networkno.de> | 2005-03-05 00:01:44 +0000 |
commit | bbe506e8ba9444fb4a00ba66762a2c498443e1b6 (patch) | |
tree | 4989bcc748cfc73d2cfb45f9321ee5247cde59ec /gas/config/tc-mips.c | |
parent | 92862f42b561a218a220939cd8a1bef7c9756d06 (diff) | |
download | fsf-binutils-gdb-bbe506e8ba9444fb4a00ba66762a2c498443e1b6.zip fsf-binutils-gdb-bbe506e8ba9444fb4a00ba66762a2c498443e1b6.tar.gz fsf-binutils-gdb-bbe506e8ba9444fb4a00ba66762a2c498443e1b6.tar.bz2 |
bfd/ChangeLog
* elfxx-mips.c (mips_elf_calculate_relocation): Handle special
'__gnu_local_gp' symbol used by gas -mno-shared.
gas/ChangeLog
* 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
* 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
* ld-mips-elf/multi-got-no-shared-1.s,
ld-mips-elf/multi-got-no-shared-2.s,
ld-mips-elf/multi-got-no-shared.d: New tests.
* ld-mips-elf/mips-elf.exp: Run them.
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r-- | gas/config/tc-mips.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index a0ad808..284d09c 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -3393,13 +3393,14 @@ macro_build_lui (expressionS *ep, int regnum) else { assert (ep->X_op == O_symbol); - /* _gp_disp is a special case, used from s_cpload. _gp is used - if mips_no_shared. */ + /* _gp_disp is a special case, used from s_cpload. + __gnu_local_gp is used if mips_no_shared. */ assert (mips_pic == NO_PIC || (! HAVE_NEWABI && strcmp (S_GET_NAME (ep->X_add_symbol), "_gp_disp") == 0) || (! mips_in_shared - && strcmp (S_GET_NAME (ep->X_add_symbol), "_gp") == 0)); + && strcmp (S_GET_NAME (ep->X_add_symbol), + "__gnu_local_gp") == 0)); *r = BFD_RELOC_HI16_S; } @@ -11819,12 +11820,12 @@ s_abicalls (int ignore ATTRIBUTE_UNUSED) The .cpload argument is normally $25 == $t9. The -mno-shared option changes this to: - lui $gp,%hi(_gp) - addiu $gp,$gp,%lo(_gp) + lui $gp,%hi(__gnu_local_gp) + addiu $gp,$gp,%lo(__gnu_local_gp) and the argument is ignored. This saves an instruction, but the resulting code is not position independent; it uses an absolute - address for _gp. Thus code assembled with -mno-shared can go into - an ordinary executable, but not into a shared library. */ + address for __gnu_local_gp. Thus code assembled with -mno-shared + can go into an ordinary executable, but not into a shared library. */ static void s_cpload (int ignore ATTRIBUTE_UNUSED) @@ -11852,7 +11853,8 @@ s_cpload (int ignore ATTRIBUTE_UNUSED) in_shared = mips_in_shared || HAVE_64BIT_SYMBOLS; ex.X_op = O_symbol; - ex.X_add_symbol = symbol_find_or_make (in_shared ? "_gp_disp" : "_gp"); + ex.X_add_symbol = symbol_find_or_make (in_shared ? "_gp_disp" : + "__gnu_local_gp"); ex.X_op_symbol = NULL; ex.X_add_number = 0; @@ -14118,6 +14120,8 @@ MIPS options:\n\ -non_shared do not generate position independent code\n\ -xgot assume a 32 bit GOT\n\ -mpdr, -mno-pdr enable/disable creation of .pdr sections\n\ +-mshared, -mno-shared disable/enable .cpload optimization for\n\ + non-shared code\n\ -mabi=ABI create ABI conformant object file for:\n")); first = 1; |