mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-02 02:45:37 +08:00
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.
This commit is contained in:
11
ld/testsuite/ld-s12z/reloc-ext18-1.d
Normal file
11
ld/testsuite/ld-s12z/reloc-ext18-1.d
Normal file
@ -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
|
11
ld/testsuite/ld-s12z/reloc-ext18-2.d
Normal file
11
ld/testsuite/ld-s12z/reloc-ext18-2.d
Normal file
@ -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
|
11
ld/testsuite/ld-s12z/reloc-ext18.d
Normal file
11
ld/testsuite/ld-s12z/reloc-ext18.d
Normal file
@ -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
|
11
ld/testsuite/ld-s12z/reloc-ext18.s
Normal file
11
ld/testsuite/ld-s12z/reloc-ext18.s
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
here:
|
||||||
|
;; ld d2, 0
|
||||||
|
.byte 0xa0
|
||||||
|
.byte 0xf8
|
||||||
|
.byte 0x00
|
||||||
|
.byte 0x00
|
||||||
|
|
||||||
|
|
||||||
|
.reloc here+1,R_S12Z_EXT18, x
|
||||||
|
|
15
ld/testsuite/ld-s12z/reloc-ext24.d
Normal file
15
ld/testsuite/ld-s12z/reloc-ext24.d
Normal file
@ -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>:
|
||||||
|
...
|
12
ld/testsuite/ld-s12z/reloc-ext24.s
Normal file
12
ld/testsuite/ld-s12z/reloc-ext24.s
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
here:
|
||||||
|
;; jmp foobar
|
||||||
|
.byte 0xba
|
||||||
|
.byte 0x00
|
||||||
|
.byte 0x00
|
||||||
|
.byte 0x00
|
||||||
|
nop
|
||||||
|
|
||||||
|
|
||||||
|
.reloc here+1,R_S12Z_EXT24, foobar
|
||||||
|
|
8
ld/testsuite/ld-s12z/reloc-ext32.d
Normal file
8
ld/testsuite/ld-s12z/reloc-ext32.d
Normal file
@ -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.
|
12
ld/testsuite/ld-s12z/reloc-ext32.s
Normal file
12
ld/testsuite/ld-s12z/reloc-ext32.s
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
here:
|
||||||
|
nop
|
||||||
|
.byte 0x00
|
||||||
|
.byte 0x00
|
||||||
|
.byte 0x00
|
||||||
|
.byte 0x00
|
||||||
|
nop
|
||||||
|
|
||||||
|
|
||||||
|
.reloc here+1,R_S12Z_EXT32, foobar
|
||||||
|
|
15
ld/testsuite/ld-s12z/reloc-opr.d
Normal file
15
ld/testsuite/ld-s12z/reloc-opr.d
Normal file
@ -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>:
|
||||||
|
...
|
8
ld/testsuite/ld-s12z/reloc-opr.s
Normal file
8
ld/testsuite/ld-s12z/reloc-opr.s
Normal file
@ -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
|
12
ld/testsuite/ld-s12z/reloc-pc-rel-7-15.d
Normal file
12
ld/testsuite/ld-s12z/reloc-pc-rel-7-15.d
Normal file
@ -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$
|
11
ld/testsuite/ld-s12z/reloc-pc-rel-7-15.s
Normal file
11
ld/testsuite/ld-s12z/reloc-pc-rel-7-15.s
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
here:
|
||||||
|
;; BLE
|
||||||
|
.byte 0x2f
|
||||||
|
.byte 0x80
|
||||||
|
.byte 0x00
|
||||||
|
nop
|
||||||
|
|
||||||
|
|
||||||
|
.reloc here+1,R_S12Z_PCREL_7_15, foo
|
||||||
|
|
Reference in New Issue
Block a user