* config/tc-mips.c (mips_need_elf_addend_fixup): Return true
authorRichard Sandiford <rdsandiford@googlemail.com>
Mon, 21 Oct 2002 14:59:30 +0000 (14:59 +0000)
committerRichard Sandiford <rdsandiford@googlemail.com>
Mon, 21 Oct 2002 14:59:30 +0000 (14:59 +0000)
for relocs against symbols in a merged section.

testsuite/
* gas/mips/elf-rel7.[sd]: New test.
* gas/mips/mips.exp: Run it.

gas/ChangeLog
gas/config/tc-mips.c
gas/testsuite/ChangeLog
gas/testsuite/gas/mips/elf-rel7.d [new file with mode: 0644]
gas/testsuite/gas/mips/elf-rel7.s [new file with mode: 0644]
gas/testsuite/gas/mips/mips.exp

index 1c9ee5bab1cd49524ae1c2b076bd2ad77d7ca6d9..adbcfa7f132ae199a73e4c4ccbaf80ed3da6c484 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-21  Richard Sandiford  <rsandifo@redhat.com>
+
+       * config/tc-mips.c (mips_need_elf_addend_fixup): Return true
+       for relocs against symbols in a merged section.
+
 2002-10-18  Alexandre Oliva  <aoliva@redhat.com>
 
        * config/tc-mips.c (md_begin): Add $fcc registers to the symbol
index de49657b3f60fb5be8f9595f8f936a1ced73f7e5..329d1a495f0cbeb2dadc543788f6c556f2473b6a 100644 (file)
@@ -10981,7 +10981,7 @@ mips_need_elf_addend_fixup (fixP)
   if (symbol_used_in_reloc_p (fixP->fx_addsy)
       && (((bfd_get_section_flags (stdoutput,
                                   S_GET_SEGMENT (fixP->fx_addsy))
-           & SEC_LINK_ONCE) != 0)
+           & (SEC_LINK_ONCE | SEC_MERGE)) != 0)
          || !strncmp (segment_name (S_GET_SEGMENT (fixP->fx_addsy)),
                       ".gnu.linkonce",
                       sizeof (".gnu.linkonce") - 1)))
index 17aa39b214c0263fe39b0c2310deacdf03716713..d6ec0cc47062abbde9cb19c80b35c66e0a0be127 100644 (file)
@@ -1,3 +1,8 @@
+2002-10-21  Richard Sandiford  <rsandifo@redhat.com>
+
+       * gas/mips/elf-rel7.[sd]: New test.
+       * gas/mips/mips.exp: Run it.
+
 2002-10-12  Alexandre Oliva  <aoliva@redhat.com>
 
        * gas/mips/mips.exp: Don't xfail relax.
diff --git a/gas/testsuite/gas/mips/elf-rel7.d b/gas/testsuite/gas/mips/elf-rel7.d
new file mode 100644 (file)
index 0000000..d72ae15
--- /dev/null
@@ -0,0 +1,31 @@
+#objdump: -dr --prefix-addresses
+#name: MIPS ELF reloc 7
+
+.*: +file format elf.*mips.*
+
+Disassembly of section \.text:
+0+00 <.*> lui  a0,0x0
+                       0: R_MIPS_HI16  .barsec
+0+04 <.*> lw   a0,8\(a0\)
+                       4: R_MIPS_LO16  .barsec
+0+08 <.*> lui  a0,0x0
+                       8: R_MIPS_HI16  bar
+0+0c <.*> lw   a0,4\(a0\)
+                       c: R_MIPS_LO16  bar
+0+10 <.*> lui  a0,0x0
+                       10: R_MIPS_HI16 bar
+0+14 <.*> lw   a0,8\(a0\)
+                       14: R_MIPS_LO16 bar
+0+18 <.*> lui  a0,0x0
+                       18: R_MIPS_HI16 frob
+0+1c <.*> lw   a0,0\(a0\)
+                       1c: R_MIPS_LO16 frob
+0+20 <.*> lui  a0,0x0
+                       20: R_MIPS_HI16 frob
+0+24 <.*> lw   a0,4\(a0\)
+                       24: R_MIPS_LO16 frob
+0+28 <.*> lui  a0,0x0
+                       28: R_MIPS_HI16 frob
+0+2c <.*> lw   a0,16\(a0\)
+                       2c: R_MIPS_LO16 frob
+#pass
diff --git a/gas/testsuite/gas/mips/elf-rel7.s b/gas/testsuite/gas/mips/elf-rel7.s
new file mode 100644 (file)
index 0000000..15665ee
--- /dev/null
@@ -0,0 +1,12 @@
+       .global frob
+       .section .barsec,"aM",@progbits,8
+       .word   0,1
+bar:   .word   2,3
+frob:  .word   4,5
+       .text
+foo:   lw      $4,bar
+       lw      $4,bar+4
+       lw      $4,bar+8
+       lw      $4,frob
+       lw      $4,frob+4
+       lw      $4,frob+16
index eac3c31d8b46f0d536e44e203b12562de702ca57..2800db198b150d05f191f32a5235b79deaff1693 100644 (file)
@@ -220,6 +220,7 @@ if { [istarget mips*-*-*] } then {
        }
        run_dump_test "elf-rel5"
        run_dump_test "elf-rel6"
+       run_dump_test "elf-rel7"
        run_dump_test "${tmips}${el}empic"
        run_dump_test "empic2"
        run_dump_test "empic3_e"