aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2002-10-21 14:59:30 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2002-10-21 14:59:30 +0000
commit631cb423b20271e4762464b851a0999babf55407 (patch)
tree6dfdcf7d6233595e8c23dd3859a1aa8d1a639df8 /gas
parent407caf07a4b0da14b9efbe68a0d75bd6c273c192 (diff)
downloadgdb-631cb423b20271e4762464b851a0999babf55407.zip
gdb-631cb423b20271e4762464b851a0999babf55407.tar.gz
gdb-631cb423b20271e4762464b851a0999babf55407.tar.bz2
* config/tc-mips.c (mips_need_elf_addend_fixup): Return true
for relocs against symbols in a merged section. testsuite/ * gas/mips/elf-rel7.[sd]: New test. * gas/mips/mips.exp: Run it.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-mips.c2
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/mips/elf-rel7.d31
-rw-r--r--gas/testsuite/gas/mips/elf-rel7.s12
-rw-r--r--gas/testsuite/gas/mips/mips.exp1
6 files changed, 55 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 1c9ee5b..adbcfa7 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -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
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index de49657..329d1a4 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -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)))
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 17aa39b..d6ec0cc 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -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
index 0000000..d72ae15
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel7.d
@@ -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
index 0000000..15665ee
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel7.s
@@ -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
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index eac3c31..2800db1 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -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"