aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorThiemo Seufer <ths@networkno.de>2005-03-05 00:01:44 +0000
committerThiemo Seufer <ths@networkno.de>2005-03-05 00:01:44 +0000
commitbbe506e8ba9444fb4a00ba66762a2c498443e1b6 (patch)
tree4989bcc748cfc73d2cfb45f9321ee5247cde59ec /bfd
parent92862f42b561a218a220939cd8a1bef7c9756d06 (diff)
downloadgdb-bbe506e8ba9444fb4a00ba66762a2c498443e1b6.zip
gdb-bbe506e8ba9444fb4a00ba66762a2c498443e1b6.tar.gz
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 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elfxx-mips.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index b2d3a3f..af8d64e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2005-03-03 H.J. Lu <hongjiu.lu@intel.com>
* elf-bfd.h (elf_backend_data): Add "const char *" to
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 5c2e5b4..847e7e6 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -3646,6 +3646,9 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
bfd_boolean local_p, was_local_p;
/* TRUE if the symbol referred to by this relocation is "_gp_disp". */
bfd_boolean gp_disp_p = FALSE;
+ /* TRUE if the symbol referred to by this relocation is
+ "__gnu_local_gp". */
+ bfd_boolean gnu_local_gp_p = FALSE;
Elf_Internal_Shdr *symtab_hdr;
size_t extsymoff;
unsigned long r_symndx;
@@ -3742,6 +3745,12 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
gp_disp_p = TRUE;
}
+ /* See if this is the special _gp symbol. Note that such a
+ symbol must always be a global symbol. */
+ else if (strcmp (*namep, "__gnu_local_gp") == 0)
+ gnu_local_gp_p = TRUE;
+
+
/* If this symbol is defined, calculate its address. Note that
_gp_disp is a magic symbol, always implicitly defined by the
linker, so it's inappropriate to check to see whether or not
@@ -3956,6 +3965,9 @@ mips_elf_calculate_relocation (bfd *abfd, bfd *input_bfd,
break;
}
+ if (gnu_local_gp_p)
+ symbol = gp;
+
/* Figure out what kind of relocation is being performed. */
switch (r_type)
{