aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-mips.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2008-03-20 10:52:14 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2008-03-20 10:52:14 +0000
commit51e38d68782784e67211a66c5408d1c1943f1aa9 (patch)
tree7df502ed85f1a2e2a42f932d85680e8463c6c176 /bfd/elfxx-mips.c
parentc65be8d78a6822e12d6037afdaddcde688f90f7a (diff)
downloadgdb-51e38d68782784e67211a66c5408d1c1943f1aa9.zip
gdb-51e38d68782784e67211a66c5408d1c1943f1aa9.tar.gz
gdb-51e38d68782784e67211a66c5408d1c1943f1aa9.tar.bz2
bfd/
* elfxx-mips.c (MIPS_ELF_GNU_GOT1_MASK): New macro. (_bfd_mips_elf_finish_dynamic_sections): Use it instead of 0x80000000. ld/testsuite/ * ld-mips-elf/elf-rel-got-n64-linux.d: Expect bit 63 rather than bit 31 of the second GOT entry to be set. * ld-mips-elf/elf-rel-got-n64.d: Likewise. * ld-mips-elf/elf-rel-xgot-n64-linux.d: Likewise. * ld-mips-elf/elf-rel-xgot-n64.d: Likewise.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r--bfd/elfxx-mips.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index 4f14140..930fc4b 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -648,6 +648,12 @@ static bfd *reldyn_sorting_bfd;
#define MIPS_RESERVED_GOTNO(INFO) \
(mips_elf_hash_table (INFO)->is_vxworks ? 3 : 2)
+/* The value to write into got[1] for SVR4 targets, to identify it is
+ a GNU object. The dynamic linker can then use got[1] to store the
+ module pointer. */
+#define MIPS_ELF_GNU_GOT1_MASK(abfd) \
+ ((bfd_vma) 1 << (ABI_64_P (abfd) ? 63 : 31))
+
/* The offset of $gp from the beginning of the .got section. */
#define ELF_MIPS_GP_OFFSET(INFO) \
(mips_elf_hash_table (INFO)->is_vxworks ? 0x0 : 0x7ff0)
@@ -9230,7 +9236,7 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
runtime. The second entry will be used by some runtime loaders.
This isn't the case of IRIX rld. */
MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0, sgot->contents);
- MIPS_ELF_PUT_WORD (output_bfd, (bfd_vma) 0x80000000,
+ MIPS_ELF_PUT_WORD (output_bfd, MIPS_ELF_GNU_GOT1_MASK (output_bfd),
sgot->contents + MIPS_ELF_GOT_SIZE (output_bfd));
}
@@ -9254,7 +9260,8 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
MIPS_ELF_PUT_WORD (output_bfd, 0, sgot->contents
+ index++ * MIPS_ELF_GOT_SIZE (output_bfd));
- MIPS_ELF_PUT_WORD (output_bfd, 0x80000000, sgot->contents
+ MIPS_ELF_PUT_WORD (output_bfd, MIPS_ELF_GNU_GOT1_MASK (output_bfd),
+ sgot->contents
+ index++ * MIPS_ELF_GOT_SIZE (output_bfd));
if (! info->shared)