From 96908638c551d9a1dc387bac823bddb7f0952547 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 9 Jul 2004 16:32:01 +0000 Subject: [PATCH] * gas/m32r/pic2.s: New file: Test case for @GOTOFF, @GOT, @PLT. * gas/m32r/pic2.d: New file: Expected results. --- gas/testsuite/ChangeLog | 6 ++++ gas/testsuite/gas/m32r/pic.exp | 1 + gas/testsuite/gas/m32r/pic2.d | 58 ++++++++++++++++++++++++++++++++++ gas/testsuite/gas/m32r/pic2.s | 55 ++++++++++++++++++++++++++++++++ 4 files changed, 120 insertions(+) create mode 100644 gas/testsuite/gas/m32r/pic2.d create mode 100644 gas/testsuite/gas/m32r/pic2.s diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 115b215e91b..bde9ac3f2ab 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2004-07-08 Kazuhiro Inaoka + + * 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 * 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 391a780aba6..1b61441e3ed 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 00000000000..5159ad3f0f4 --- /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 : + 0: 7e 01 f0 00 bl 4 \|\| nop + 4: ec 00 00 00 ld24 r12,0 + 4: R_M32R_GOTPC24 _GLOBAL_OFFSET_TABLE_ + 8: 0c ae f0 00 add r12,lr \|\| nop + +0+000c : + c: 7e 01 f0 00 bl 10 \|\| 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 : + 1c: 7e 01 f0 00 bl 20 \|\| 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 : + 2c: e0 00 00 00 ld24 r0,0 + 2c: R_M32R_GOTOFF sym + +0+0030 : + 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 : + 40: fe 00 00 00 bl 40 + 40: R_M32R_26_PLTREL func + +0+0044 : + 44: e0 00 00 00 ld24 r0,0 + 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 00000000000..0f3d28585c3 --- /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 -- 2.30.2