aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2002-08-01 20:14:49 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2002-08-01 20:14:49 +0000
commit9860559818f2a3fe6306660aa37e3e9bbf3cfe0b (patch)
tree8a2cd66dc334d53875880a0e44ca92bb6417ef8d /gas
parent78fde5f8a3d9a099f17a7eefd272edc007fbc927 (diff)
downloadgdb-9860559818f2a3fe6306660aa37e3e9bbf3cfe0b.zip
gdb-9860559818f2a3fe6306660aa37e3e9bbf3cfe0b.tar.gz
gdb-9860559818f2a3fe6306660aa37e3e9bbf3cfe0b.tar.bz2
[gas/]
* config/tc-mips.c (tc_gen_reloc): Extend GP-relative addend handling to BFD_RELOC_MIPS16_GPREL. [gas/testsuite/] * gas/mips/elf-rel6.[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-rel6.d10
-rw-r--r--gas/testsuite/gas/mips/elf-rel6.s16
-rw-r--r--gas/testsuite/gas/mips/mips.exp1
6 files changed, 38 insertions, 1 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 3493ddb..aea7842 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-01 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/tc-mips.c (tc_gen_reloc): Extend GP-relative addend
+ handling to BFD_RELOC_MIPS16_GPREL.
+
2002-08-01 Nick Clifton <nickc@redhat.com>
* config/tc-arm.c (add_to_lit_pool): Ensure that offset to literal
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 0290587..c8eba55 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -12694,7 +12694,7 @@ tc_gen_reloc (section, fixp)
stop md_apply_fix3 from subtracting twice in the first place since
the fake addend is required for variant frags above. */
if (fixp->fx_addsy != NULL && OUTPUT_FLAVOR == bfd_target_elf_flavour
- && code == BFD_RELOC_GPREL16
+ && (code == BFD_RELOC_GPREL16 || code == BFD_RELOC_MIPS16_GPREL)
&& reloc->addend != 0
&& mips_need_elf_addend_fixup (fixp))
reloc->addend += S_GET_VALUE (fixp->fx_addsy);
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 76a4462..8d211f7 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-01 Richard Sandiford <rsandifo@redhat.com>
+
+ * gas/mips/elf-rel6.[sd]: New test.
+ * gas/mips/mips.exp: Run it.
+
2002-07-29 Chris Demetriou <cgd@broadcom.com>
* gas/mips/elf_ase_mips16.d: New file to test ELF MIPS16 ASE marking.
diff --git a/gas/testsuite/gas/mips/elf-rel6.d b/gas/testsuite/gas/mips/elf-rel6.d
new file mode 100644
index 0000000..5baadf9
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel6.d
@@ -0,0 +1,10 @@
+#objdump: -dr --prefix-addresses
+#name: MIPS ELF reloc 6
+
+.*: +file format elf.*mips.*
+
+Disassembly of section \.text:
+0+00 <.*> lb v0,0\(v1\)
+ 0: R_MIPS16_GPREL bar
+0+04 <.*> lb v0,1\(v1\)
+ 4: R_MIPS16_GPREL bar
diff --git a/gas/testsuite/gas/mips/elf-rel6.s b/gas/testsuite/gas/mips/elf-rel6.s
new file mode 100644
index 0000000..e0bc37a
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel6.s
@@ -0,0 +1,16 @@
+ .sdata
+ .global foo
+ .globl bar
+foo: .byte 1
+ .byte 2
+bar: .byte 3
+ .byte 4
+
+ .text
+ .set mips16
+ .global f
+ .ent f
+f:
+ lb $2,%gprel(bar)($3)
+ lb $2,%gprel(bar+1)($3)
+ .end f
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 1b02f71..a3b6911 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -205,6 +205,7 @@ if { [istarget mips*-*-*] } then {
run_dump_test "e32-rel4"
}
run_dump_test "elf-rel5"
+ run_dump_test "elf-rel6"
run_dump_test "${tmips}${el}empic"
run_dump_test "empic2"
run_dump_test "empic3_e"