aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2003-02-08 17:05:55 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2003-02-08 17:05:55 +0000
commit5919d0127e12dfe3d3190ba3468c71782cb16b02 (patch)
treeea35f74913dd8981ddc30119e1d9b96f70b9bc1e /gas/testsuite
parent00b28bb047a8304ba4f00433072b8f1bd8f35e60 (diff)
downloadgdb-5919d0127e12dfe3d3190ba3468c71782cb16b02.zip
gdb-5919d0127e12dfe3d3190ba3468c71782cb16b02.tar.gz
gdb-5919d0127e12dfe3d3190ba3468c71782cb16b02.tar.bz2
gas/
* config/tc-mips.c (reloc_needs_lo_p): New function. (fixup_has_matching_lo_p): New function. (append_insn): Use reloc_needs_lo_p to check whether a relocation might need a matching %lo(). Reuse the head of mips_hi_fixup_list if that fixup already has a matching %lo(). Don't call frag_wane here. (macro): Call frag_wane here if the last unmatched hi was in the current frag. (pic_need_relax): New function, split out from... (md_estimate_size_before_relax): ...here. (mips_frob_file): Use reloc_needs_lo_p. Use pic_need_relax to test whether BFD_RELOC_MIPS_GOT16 fixups refer to global symbols. gas/testsuite/ * gas/mips/rel12.[sd], gas/mips/rel13.[sd]: New tests. * gas/mips/mips.exp: Run them.
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/mips/elf-rel12.d11
-rw-r--r--gas/testsuite/gas/mips/elf-rel12.s14
-rw-r--r--gas/testsuite/gas/mips/elf-rel13.d17
-rw-r--r--gas/testsuite/gas/mips/elf-rel13.s22
-rw-r--r--gas/testsuite/gas/mips/mips.exp2
6 files changed, 71 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 0bbc35a..c9be2ed 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2003-02-07 Richard Sandiford <rsandifo@redhat.com>
+ * gas/mips/rel12.[sd], gas/mips/rel13.[sd]: New tests.
+ * gas/mips/mips.exp: Run them.
+
+2003-02-07 Richard Sandiford <rsandifo@redhat.com>
+
* gas/mips/expr1.[sd]: New test.
* gas/mips/mips.exp: Run it.
diff --git a/gas/testsuite/gas/mips/elf-rel12.d b/gas/testsuite/gas/mips/elf-rel12.d
new file mode 100644
index 0000000..c57a83c
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel12.d
@@ -0,0 +1,11 @@
+#as: -march=mips1 -mabi=32
+#readelf: --relocs
+#name: MIPS ELF reloc 12
+
+Relocation section '\.rel\.text' at offset .* contains 4 entries:
+ *Offset * Info * Type * Sym\.Value * Sym\. Name
+0+0004 * 0+..05 * R_MIPS_HI16 * 0+0000 * l1
+0+0008 * 0+..06 * R_MIPS_LO16 * 0+0000 * l1
+0+0000 * 0+..05 * R_MIPS_HI16 * 0+0004 * l2
+0+000c * 0+..06 * R_MIPS_LO16 * 0+0004 * l2
+#pass
diff --git a/gas/testsuite/gas/mips/elf-rel12.s b/gas/testsuite/gas/mips/elf-rel12.s
new file mode 100644
index 0000000..a3c4021
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel12.s
@@ -0,0 +1,14 @@
+ .ent foo
+foo:
+ lui $4,%hi(l2)
+ la $3,l1
+ addiu $4,$4,%lo(l2)
+
+ .space 64
+ .end foo
+
+ .globl l1
+ .globl l2
+ .data
+l1: .word 1
+l2: .word 2
diff --git a/gas/testsuite/gas/mips/elf-rel13.d b/gas/testsuite/gas/mips/elf-rel13.d
new file mode 100644
index 0000000..0c3289d
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel13.d
@@ -0,0 +1,17 @@
+#as: -march=mips2 -mabi=32 -KPIC
+#readelf: --relocs
+#name: MIPS ELF reloc 13
+
+Relocation section '\.rel\.text' at offset .* contains 9 entries:
+ *Offset * Info * Type * Sym\.Value * Sym\. Name
+0+0000 * 0+..09 * R_MIPS_GOT16 * 0+0000 * \.data
+0+0014 * 0+..06 * R_MIPS_LO16 * 0+0000 * \.data
+0+0010 * 0+..09 * R_MIPS_GOT16 * 0+0000 * \.data
+0+0018 * 0+..06 * R_MIPS_LO16 * 0+0000 * \.data
+# The next two lines could be in either order.
+0+000c * 0+..09 * R_MIPS_GOT16 * 0+0000 * \.rodata
+0+0008 * 0+..09 * R_MIPS_GOT16 * 0+0000 * \.rodata
+0+001c * 0+..06 * R_MIPS_LO16 * 0+0000 * \.rodata
+0+0004 * 0+..09 * R_MIPS_GOT16 * 0+0000 * \.bss
+0+0020 * 0+..06 * R_MIPS_LO16 * 0+0000 * \.bss
+#pass
diff --git a/gas/testsuite/gas/mips/elf-rel13.s b/gas/testsuite/gas/mips/elf-rel13.s
new file mode 100644
index 0000000..761fcbb
--- /dev/null
+++ b/gas/testsuite/gas/mips/elf-rel13.s
@@ -0,0 +1,22 @@
+ .ent foo
+foo:
+ lw $4,%got(l1)($gp)
+ lw $4,%got(l2)($gp)
+ lw $4,%got(l3)($gp)
+ lw $4,%got(l3)($gp)
+ lw $4,%got(l1+0x400)($gp)
+ addiu $4,$4,%lo(l1)
+ addiu $4,$4,%lo(l1+0x400)
+ addiu $4,$4,%lo(l3)
+ addiu $4,$4,%lo(l2)
+ .space 64
+ .end foo
+
+ .data
+l1: .word 1
+
+ .lcomm l2, 4
+
+ .rdata
+ .word 1
+l3: .word 2
diff --git a/gas/testsuite/gas/mips/mips.exp b/gas/testsuite/gas/mips/mips.exp
index 090e0b5..9d950a4 100644
--- a/gas/testsuite/gas/mips/mips.exp
+++ b/gas/testsuite/gas/mips/mips.exp
@@ -608,6 +608,8 @@ if { [istarget mips*-*-*] } then {
run_dump_test "elf-rel10"
run_dump_test "elf-rel11"
}
+ run_dump_test "elf-rel12"
+ run_dump_test "elf-rel13"
run_dump_test "${tmips}${el}empic"
run_dump_test "empic2"
run_dump_test "empic3_e"