diff options
author | John Darrington <john@darrington.wattle.id.au> | 2018-09-03 13:22:36 +0200 |
---|---|---|
committer | John Darrington <john@darrington.wattle.id.au> | 2018-09-16 17:50:09 +0200 |
commit | 43276309ded887327f434374b37572d1bc0778eb (patch) | |
tree | fea8a90d61ee7e8758181583d33b7f4e911a62ce /ld/testsuite/ld-s12z | |
parent | 57d5aa265f50b8c8c1ebbe4e67285aa9f5a53369 (diff) | |
download | gdb-43276309ded887327f434374b37572d1bc0778eb.zip gdb-43276309ded887327f434374b37572d1bc0778eb.tar.gz gdb-43276309ded887327f434374b37572d1bc0778eb.tar.bz2 |
S12Z Add tests for relocs.
ld/testsuite/ld-s12z/
* reloc-ext18-1.d: New file.
* reloc-ext18-1.d: New file.
* reloc-ext18-2.d: New file.
* reloc-ext18.d: New file.
* reloc-ext18.s: New file.
* reloc-ext24.d: New file.
* reloc-ext24.s: New file.
* reloc-ext32.d: New file.
* reloc-ext32.s: New file.
* reloc-opr.d: New file.
* reloc-opr.d: New file.
* reloc-opr.s: New file.
* reloc-pc-rel-7-15.d: New file.
* reloc-pc-rel-7-15.s: New file.
Diffstat (limited to 'ld/testsuite/ld-s12z')
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-ext18-1.d | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-ext18-2.d | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-ext18.d | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-ext18.s | 11 | ||||
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-ext24.d | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-ext24.s | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-ext32.d | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-ext32.s | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-opr.d | 15 | ||||
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-opr.s | 8 | ||||
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-pc-rel-7-15.d | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-s12z/reloc-pc-rel-7-15.s | 11 |
12 files changed, 137 insertions, 0 deletions
diff --git a/ld/testsuite/ld-s12z/reloc-ext18-1.d b/ld/testsuite/ld-s12z/reloc-ext18-1.d new file mode 100644 index 0000000..8bf3154 --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-ext18-1.d @@ -0,0 +1,11 @@ +#source: reloc-ext18.s +#ld: --no-relax --defsym x=0x1abcd +#objdump: -d -r + +tmpdir/dump: file format elf32-s12z + + +Disassembly of section .text: + +00fe0000 <here>: + fe0000: a0 f9 ab cd ld d2, x diff --git a/ld/testsuite/ld-s12z/reloc-ext18-2.d b/ld/testsuite/ld-s12z/reloc-ext18-2.d new file mode 100644 index 0000000..5995782 --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-ext18-2.d @@ -0,0 +1,11 @@ +#source: reloc-ext18.s +#ld: --no-relax --defsym x=0x2abcd +#objdump: -d -r + +tmpdir/dump: file format elf32-s12z + + +Disassembly of section .text: + +00fe0000 <here>: + fe0000: a0 fc ab cd ld d2, x diff --git a/ld/testsuite/ld-s12z/reloc-ext18.d b/ld/testsuite/ld-s12z/reloc-ext18.d new file mode 100644 index 0000000..c558621 --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-ext18.d @@ -0,0 +1,11 @@ +#source: reloc-ext18.s +#ld: --no-relax --defsym x=0xabcd +#objdump: -d -r + +tmpdir/dump: file format elf32-s12z + + +Disassembly of section .text: + +00fe0000 <here>: + fe0000: a0 f8 ab cd ld d2, x diff --git a/ld/testsuite/ld-s12z/reloc-ext18.s b/ld/testsuite/ld-s12z/reloc-ext18.s new file mode 100644 index 0000000..172bc8c --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-ext18.s @@ -0,0 +1,11 @@ + +here: + ;; ld d2, 0 + .byte 0xa0 + .byte 0xf8 + .byte 0x00 + .byte 0x00 + + +.reloc here+1,R_S12Z_EXT18, x + diff --git a/ld/testsuite/ld-s12z/reloc-ext24.d b/ld/testsuite/ld-s12z/reloc-ext24.d new file mode 100644 index 0000000..2eb7e8e --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-ext24.d @@ -0,0 +1,15 @@ +#source: reloc-ext24.s +#ld: --no-relax --defsym foobar=0xabcdef +#objdump: -d -r + +tmpdir/dump: file format elf32-s12z + + +Disassembly of section .text: + +00fe0000 <here>: + fe0000: ba ab cd ef jmp foobar + fe0004: 01 nop + +00fe0005 <_etext>: + ... diff --git a/ld/testsuite/ld-s12z/reloc-ext24.s b/ld/testsuite/ld-s12z/reloc-ext24.s new file mode 100644 index 0000000..539b5ac --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-ext24.s @@ -0,0 +1,12 @@ + +here: + ;; jmp foobar + .byte 0xba + .byte 0x00 + .byte 0x00 + .byte 0x00 + nop + + +.reloc here+1,R_S12Z_EXT24, foobar + diff --git a/ld/testsuite/ld-s12z/reloc-ext32.d b/ld/testsuite/ld-s12z/reloc-ext32.d new file mode 100644 index 0000000..ec74b88 --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-ext32.d @@ -0,0 +1,8 @@ +#source: reloc-ext32.s +#ld: --no-relax --defsym foobar=0x12345678 +#objdump: -r -s --section=.text + +tmpdir/dump: file format elf32-s12z + +Contents of section .text: + fe0000 01123456 7801 ..4Vx. diff --git a/ld/testsuite/ld-s12z/reloc-ext32.s b/ld/testsuite/ld-s12z/reloc-ext32.s new file mode 100644 index 0000000..ce16e44 --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-ext32.s @@ -0,0 +1,12 @@ + +here: + nop + .byte 0x00 + .byte 0x00 + .byte 0x00 + .byte 0x00 + nop + + +.reloc here+1,R_S12Z_EXT32, foobar + diff --git a/ld/testsuite/ld-s12z/reloc-opr.d b/ld/testsuite/ld-s12z/reloc-opr.d new file mode 100644 index 0000000..35736c5 --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-opr.d @@ -0,0 +1,15 @@ +#source: reloc-opr.s +#ld: --no-relax --defsym bar=0xabcdef +#objdump: -d -r + +tmpdir/dump: file format elf32-s12z + + +Disassembly of section .text: + +00fe0000 <_etext-0x5>: + fe0000: 83 fa ab cd sub d5, bar + fe0004: ef + +00fe0005 <_etext>: + ... diff --git a/ld/testsuite/ld-s12z/reloc-opr.s b/ld/testsuite/ld-s12z/reloc-opr.s new file mode 100644 index 0000000..bfb153d --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-opr.s @@ -0,0 +1,8 @@ + +;;; This byte sequence corresponds to sub d5, xxx + .byte 0x83 + .byte 0xfa + .byte 0x00 + .byte 0x00 + .byte 0x00 + .reloc .-3,R_S12Z_OPR,bar diff --git a/ld/testsuite/ld-s12z/reloc-pc-rel-7-15.d b/ld/testsuite/ld-s12z/reloc-pc-rel-7-15.d new file mode 100644 index 0000000..f408728 --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-pc-rel-7-15.d @@ -0,0 +1,12 @@ +#source: reloc-pc-rel-7-15.s +#ld: --no-relax --defsym here=0xfe0000 --defsym foo=here-9 +#objdump: -d -r + +tmpdir/dump: file format elf32-s12z + + +Disassembly of section .text: + +00fe0000 <here>: + fe0000: 2f ff f6 ble \*\-10 + fe0003: 01 nop$
\ No newline at end of file diff --git a/ld/testsuite/ld-s12z/reloc-pc-rel-7-15.s b/ld/testsuite/ld-s12z/reloc-pc-rel-7-15.s new file mode 100644 index 0000000..9c7c622 --- /dev/null +++ b/ld/testsuite/ld-s12z/reloc-pc-rel-7-15.s @@ -0,0 +1,11 @@ + +here: + ;; BLE + .byte 0x2f + .byte 0x80 + .byte 0x00 + nop + + +.reloc here+1,R_S12Z_PCREL_7_15, foo + |