bfd/
authorRichard Sandiford <rdsandiford@googlemail.com>
Thu, 20 Mar 2008 10:52:14 +0000 (10:52 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Thu, 20 Mar 2008 10:52:14 +0000 (10:52 +0000)
* 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.

bfd/ChangeLog
bfd/elfxx-mips.c
ld/testsuite/ChangeLog
ld/testsuite/ld-mips-elf/elf-rel-got-n64-linux.d
ld/testsuite/ld-mips-elf/elf-rel-got-n64.d
ld/testsuite/ld-mips-elf/elf-rel-xgot-n64-linux.d
ld/testsuite/ld-mips-elf/elf-rel-xgot-n64.d

index c6157add39d1421842bb778d19c18e595afa841d..333cd1f69aaad2e8696e6b8a8fc13212250b8f8c 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-20  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       * elfxx-mips.c (MIPS_ELF_GNU_GOT1_MASK): New macro.
+       (_bfd_mips_elf_finish_dynamic_sections): Use it instead of 0x80000000.
+
 2008-03-20  Alan Modra  <amodra@bigpond.net.au>
 
        * elf32-spu.c (spu_elf_create_sections): Remove output_bfd parameter.
index 4f141402b0b9e05937b9239cd4118e973b68e136..930fc4bd415bb83d1f66b531667deb7eef289809 100644 (file)
@@ -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)
index 6ff1af70b818e5ed71cef9b7dadf2436fb3ab043..2068cb9a1e52f7c913d0555bd13c57b377e355eb 100644 (file)
@@ -1,3 +1,11 @@
+2008-03-20  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       * 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.
+
 2008-03-17  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        * ld-mips-elf/eh-frame1-n32.d: Expect a warning about .eh_frame_hdr.
index 94c3097435d65034aac6633c305645f7b08e16e6..946751ef03772ae650f07e288850e1c73a9f5209 100644 (file)
@@ -294,7 +294,8 @@ Disassembly of section \.got:
 
 00000001200105e0 <_GLOBAL_OFFSET_TABLE_>:
        \.\.\.
-   1200105ec:  80000000        .*
+   1200105e8:  80000000        .*
+   1200105ec:  00000000        .*
    1200105f0:  00000001        .*
    1200105f4:  20010000        .*
    1200105f8:  00000001        .*
index 3047911cc1502b04fda3310661af0617578b474f..8ebfdf8101d3f578833c64150a8e6b77e4d4260e 100644 (file)
@@ -293,7 +293,8 @@ Disassembly of section \.got:
 
 00000000101005e0 <_GLOBAL_OFFSET_TABLE_>:
        \.\.\.
-    101005ec:  80000000        .*
+    101005e8:  80000000        .*
+    101005ec:  00000000        .*
     101005f0:  00000000        .*
     101005f4:  1010052c        .*
     101005f8:  00000000        .*
index 8baa1952284bfa2889f3b3e122ff9edea1465075..4eb41a60b25536a42ea30bcfb4fa26ee07fb9a2c 100644 (file)
@@ -418,7 +418,8 @@ Disassembly of section \.got:
 
 00000001200107d0 <_GLOBAL_OFFSET_TABLE_>:
        \.\.\.
-   1200107dc:  80000000        .*
+   1200107d8:  80000000        .*
+   1200107dc:  00000000        .*
    1200107e0:  00000001        .*
    1200107e4:  20010000        .*
    1200107e8:  00000001        .*
index b07c86117691c01aaf960a06e9f62aa463ff478a..0111f78752230fc35cdfaa5d5b5d3be5d54c95ac 100644 (file)
@@ -417,7 +417,8 @@ Disassembly of section \.got:
 
 00000000101007d0 <_GLOBAL_OFFSET_TABLE_>:
        \.\.\.
-    101007dc:  80000000        .*
+    101007d8:  80000000        .*
+    101007dc:  00000000        .*
     101007e0:  00000000        .*
     101007e4:  10100000        .*
     101007e8:  00000000        .*
This page took 0.034033 seconds and 4 git commands to generate.