diff options
author | Mickael Guene <mickael.guene@st.com> | 2015-12-16 10:09:05 +0100 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2015-12-16 10:19:51 +0100 |
commit | 72d98d16ed09584660d0cbb759d90f8dfeef2343 (patch) | |
tree | 6a1f1e78ca24f2306e718025bf4d90d891956880 /gas/testsuite | |
parent | 9c35a5290213e9a28e6cc691e1cc7ba5055653f7 (diff) | |
download | gdb-72d98d16ed09584660d0cbb759d90f8dfeef2343.zip gdb-72d98d16ed09584660d0cbb759d90f8dfeef2343.tar.gz gdb-72d98d16ed09584660d0cbb759d90f8dfeef2343.tar.bz2 |
[ARM] Add support for thumb1 pcrop relocations.
To support thumb1 execute-only code we need to support four new
relocations (R_ARM_THM_ALU_ABS_G0_NC, R_ARM_THM_ALU_ABS_G1_NC,
R_ARM_THM_ALU_ABS_G2_NC and R_ARM_THM_ALU_ABS_G3_NC).
These relocations allow the static linker to finalize construction
of symbol address.
Typical sequence of code to get address of the symbol foo is then
the following :
movs r3, #:upper8_15:#foo
lsls r3, #8
adds r3, #:upper0_7:#foo
lsls r3, #8
adds r3, #:lower8_15:#foo
lsls r3, #8
adds r3, #:lower0_7:#foo
This will give following sequence of text and relocations after
assembly :
4: 2300 movs r3, #0
4: R_ARM_THM_ALU_ABS_G3_NC foo
6: 021b lsls r3, r3, #8
8: 3300 adds r3, #0
8: R_ARM_THM_ALU_ABS_G2_NC foo
a: 021b lsls r3, r3, #8
c: 3300 adds r3, #0
c: R_ARM_THM_ALU_ABS_G1_NC foo
e: 021b lsls r3, r3, #8
10: 3300 adds r3, #0
10: R_ARM_THM_ALU_ABS_G0_NC foo
Diffstat (limited to 'gas/testsuite')
-rw-r--r-- | gas/testsuite/gas/arm/adds-thumb1-reloc-local.d | 16 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/adds-thumb1-reloc-local.s | 13 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/movs-thumb1-reloc-local.d | 16 | ||||
-rw-r--r-- | gas/testsuite/gas/arm/movs-thumb1-reloc-local.s | 13 |
4 files changed, 58 insertions, 0 deletions
diff --git a/gas/testsuite/gas/arm/adds-thumb1-reloc-local.d b/gas/testsuite/gas/arm/adds-thumb1-reloc-local.d new file mode 100644 index 0000000..190f0ab --- /dev/null +++ b/gas/testsuite/gas/arm/adds-thumb1-reloc-local.d @@ -0,0 +1,16 @@ +#objdump: -dr --prefix-addresses --show-raw-insn +#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix* +#name: ADDS relocations against local symbols for armv6s-m + +.*: +file format .*arm.* + +Disassembly of section .text: +0[0-9a-f]+ <[^>]+> 3000 adds r0, #0 + 0: R_ARM_THM_ALU_ABS_G3_NC bar +0[0-9a-f]+ <[^>]+> 3000 adds r0, #0 + 2: R_ARM_THM_ALU_ABS_G2_NC bar +0[0-9a-f]+ <[^>]+> 3000 adds r0, #0 + 4: R_ARM_THM_ALU_ABS_G1_NC bar +0[0-9a-f]+ <[^>]+> 3000 adds r0, #0 + 6: R_ARM_THM_ALU_ABS_G0_NC bar +#... diff --git a/gas/testsuite/gas/arm/adds-thumb1-reloc-local.s b/gas/testsuite/gas/arm/adds-thumb1-reloc-local.s new file mode 100644 index 0000000..4e1ebcc --- /dev/null +++ b/gas/testsuite/gas/arm/adds-thumb1-reloc-local.s @@ -0,0 +1,13 @@ +.arch armv6s-m +.text +.syntax unified +.thumb +foo: +adds r0, #:upper8_15:#bar +adds r0, #:upper0_7:#bar +adds r0, #:lower8_15:#bar +adds r0, #:lower0_7:#bar + +.space 0x10000 + +bar: diff --git a/gas/testsuite/gas/arm/movs-thumb1-reloc-local.d b/gas/testsuite/gas/arm/movs-thumb1-reloc-local.d new file mode 100644 index 0000000..3febca3 --- /dev/null +++ b/gas/testsuite/gas/arm/movs-thumb1-reloc-local.d @@ -0,0 +1,16 @@ +#objdump: -dr --prefix-addresses --show-raw-insn +#skip: *-*-*coff *-*-pe *-*-wince *-*-*aout* *-*-netbsd *-*-riscix* +#name: MOVS relocations against local symbols for armv6s-m + +.*: +file format .*arm.* + +Disassembly of section .text: +0[0-9a-f]+ <[^>]+> 2000 movs r0, #0 + 0: R_ARM_THM_ALU_ABS_G3_NC bar +0[0-9a-f]+ <[^>]+> 2000 movs r0, #0 + 2: R_ARM_THM_ALU_ABS_G2_NC bar +0[0-9a-f]+ <[^>]+> 2000 movs r0, #0 + 4: R_ARM_THM_ALU_ABS_G1_NC bar +0[0-9a-f]+ <[^>]+> 2000 movs r0, #0 + 6: R_ARM_THM_ALU_ABS_G0_NC bar +#... diff --git a/gas/testsuite/gas/arm/movs-thumb1-reloc-local.s b/gas/testsuite/gas/arm/movs-thumb1-reloc-local.s new file mode 100644 index 0000000..c0fc383 --- /dev/null +++ b/gas/testsuite/gas/arm/movs-thumb1-reloc-local.s @@ -0,0 +1,13 @@ +.arch armv6s-m +.text +.syntax unified +.thumb +foo: +movs r0, #:upper8_15:#bar +movs r0, #:upper0_7:#bar +movs r0, #:lower8_15:#bar +movs r0, #:lower0_7:#bar + +.space 0x10000 + +bar: |