summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-07-09 16:32:01 +0000
committerNick Clifton <nickc@redhat.com>2004-07-09 16:32:01 +0000
commit595e5689b8e03e262e04e1f006873a76d0f61105 (patch)
tree2ce6f677f06eed41fb042101b330222cc6b97e3c
parent644e042770f2427c8e331e1006d568831def786f (diff)
downloadbinutils-redhat-595e5689b8e03e262e04e1f006873a76d0f61105.tar.gz
* gas/m32r/pic2.s: New file: Test case for @GOTOFF, @GOT, @PLT.
* gas/m32r/pic2.d: New file: Expected results.
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/m32r/pic.exp1
-rw-r--r--gas/testsuite/gas/m32r/pic2.d58
-rw-r--r--gas/testsuite/gas/m32r/pic2.s55
4 files changed, 120 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 115b215e91..bde9ac3f2a 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-08 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * gas/m32r/pic.exp: Add New Test case for @GOTOFF, @GOT, @PLT.
+ * gas/m32r/pic2.s: New file: Test case for @GOTOFF, @GOT, @PLT.
+ * gas/m32r/pic2.d: New file: Expected results.
+
2004-07-08 Richard Sandiford <rsandifo@redhat.com>
* gas/mips/elf-rel7.d: Expect relocations against bar to refer to bar.
diff --git a/gas/testsuite/gas/m32r/pic.exp b/gas/testsuite/gas/m32r/pic.exp
index 391a780aba..1b61441e3e 100644
--- a/gas/testsuite/gas/m32r/pic.exp
+++ b/gas/testsuite/gas/m32r/pic.exp
@@ -2,4 +2,5 @@
if [istarget m32r*-*-*] {
run_dump_test "pic"
+ run_dump_test "pic2"
}
diff --git a/gas/testsuite/gas/m32r/pic2.d b/gas/testsuite/gas/m32r/pic2.d
new file mode 100644
index 0000000000..5159ad3f0f
--- /dev/null
+++ b/gas/testsuite/gas/m32r/pic2.d
@@ -0,0 +1,58 @@
+#objdump: -dr
+#name: pic2
+
+.*: +file format .*
+
+Disassembly of section .text:
+
+0+0000 <pic_gotpc>:
+ 0: 7e 01 f0 00 bl 4 <pic_gotpc\+0x4> \|\| nop
+ 4: ec 00 00 00 ld24 r12,0 <pic_gotpc>
+ 4: R_M32R_GOTPC24 _GLOBAL_OFFSET_TABLE_
+ 8: 0c ae f0 00 add r12,lr \|\| nop
+
+0+000c <pic_gotpc_slo>:
+ c: 7e 01 f0 00 bl 10 <pic_gotpc_slo\+0x4> \|\| nop
+ 10: dc c0 00 00 seth r12,[#]0x0
+ 10: R_M32R_GOTPC_HI_SLO _GLOBAL_OFFSET_TABLE_
+ 14: 8c ac 00 00 add3 r12,r12,[#]0
+ 14: R_M32R_GOTPC_LO _GLOBAL_OFFSET_TABLE_\+0x4
+ 18: 0c ae f0 00 add r12,lr \|\| nop
+
+0+001c <pic_gotpc_ulo>:
+ 1c: 7e 01 f0 00 bl 20 <pic_gotpc_ulo\+0x4> \|\| nop
+ 20: dc c0 00 00 seth r12,[#]0x0
+ 20: R_M32R_GOTPC_HI_ULO _GLOBAL_OFFSET_TABLE_
+ 24: 8c ec 00 00 or3 r12,r12,[#]0x0
+ 24: R_M32R_GOTPC_LO _GLOBAL_OFFSET_TABLE_\+0x4
+ 28: 0c ae f0 00 add r12,lr \|\| nop
+
+0+002c <pic_got>:
+ 2c: e0 00 00 00 ld24 r0,0 <pic_gotpc>
+ 2c: R_M32R_GOTOFF sym
+
+0+0030 <pic_got16>:
+ 30: dc c0 00 00 seth r12,[#]0x0
+ 30: R_M32R_GOT16_HI_SLO sym2
+ 34: 8c ac 00 00 add3 r12,r12,[#]0
+ 34: R_M32R_GOT16_LO sym2
+ 38: dc c0 00 00 seth r12,[#]0x0
+ 38: R_M32R_GOTOFF_HI_ULO sym2
+ 3c: 8c ec 00 00 or3 r12,r12,[#]0x0
+ 3c: R_M32R_GOT16_LO sym2
+
+0+0040 <pic_plt>:
+ 40: fe 00 00 00 bl 40 <pic_plt>
+ 40: R_M32R_26_PLTREL func
+
+0+0044 <gotoff>:
+ 44: e0 00 00 00 ld24 r0,0 <pic_gotpc>
+ 44: R_M32R_GOTOFF .text\+0x44
+ 48: d0 c0 00 00 seth r0,[#]0x0
+ 48: R_M32R_GOTOFF_HI_SLO .text\+0x44
+ 4c: 80 a0 00 00 add3 r0,r0,[#]0
+ 4c: R_M32R_GOTOFF_LO .text\+0x44
+ 50: d0 c0 00 00 seth r0,[#]0x0
+ 50: R_M32R_GOTOFF_HI_ULO .text\+0x44
+ 54: 80 e0 00 00 or3 r0,r0,[#]0x0
+ 54: R_M32R_GOTOFF_LO .text\+0x44
diff --git a/gas/testsuite/gas/m32r/pic2.s b/gas/testsuite/gas/m32r/pic2.s
new file mode 100644
index 0000000000..0f3d28585c
--- /dev/null
+++ b/gas/testsuite/gas/m32r/pic2.s
@@ -0,0 +1,55 @@
+ .section .text
+# R_M32R_GOTPC24
+pic_gotpc:
+ bl.s .+4
+ ld24 r12,#_GLOBAL_OFFSET_TABLE_
+ add r12,lr
+
+# R_M32R_GOTPC_HI_ULO
+# R_M32R_GOTPC_HI_SLO
+# R_M32R_GOTPC_LO
+pic_gotpc_slo:
+ bl.s .+4
+ seth r12,#shigh(_GLOBAL_OFFSET_TABLE_)
+ add3 r12,r12,#low(_GLOBAL_OFFSET_TABLE_+4)
+ add r12,lr
+
+pic_gotpc_ulo:
+ bl.s .+4
+ seth r12,#high(_GLOBAL_OFFSET_TABLE_)
+ or3 r12,r12,#low(_GLOBAL_OFFSET_TABLE_+4)
+ add r12,lr
+
+# R_M32R_GOT24
+pic_got:
+ .global sym
+ ld24 r0,#sym@GOTOFF
+
+# R_M32R_GOT16_HI_ULO
+# R_M32R_GOT16_HI_SLO
+# R_M32R_GOT16_LO
+pic_got16:
+ .global sym2
+ seth r12,#shigh(sym2@GOT)
+ add3 r12,r12,#low(sym2@GOT)
+ seth r12,#high(sym2@GOTOFF)
+ or3 r12,r12,#low(sym2@GOT)
+
+# R_M32R_26_PLTREL
+pic_plt:
+ .global func
+ bl func@PLT
+
+# R_M32R_GOTOFF
+gotoff:
+ ld24 r0,#gotoff@GOTOFF
+
+# R_M32R_GOTOFF_HI_ULO
+# R_M32R_GOTOFF_HI_SLO
+# R_M32R_GOTOFF_LO
+ seth r0,#shigh(gotoff@GOTOFF)
+ add3 r0,r0,#low(gotoff@GOTOFF)
+ seth r0,#high(gotoff@GOTOFF)
+ or3 r0,r0,#low(gotoff@GOTOFF)
+
+ .end