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 /ld/testsuite/ld-arm/thumb1-movs.d | |
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 'ld/testsuite/ld-arm/thumb1-movs.d')
-rw-r--r-- | ld/testsuite/ld-arm/thumb1-movs.d | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ld/testsuite/ld-arm/thumb1-movs.d b/ld/testsuite/ld-arm/thumb1-movs.d new file mode 100644 index 0000000..6a72bc1 --- /dev/null +++ b/ld/testsuite/ld-arm/thumb1-movs.d @@ -0,0 +1,38 @@ + +.*: file format.* + +Disassembly of section .text: + +00008000 <[^>]*>: + 8000: 2012 movs r0, #18 + 8002: 2134 movs r1, #52 ; 0x34 + 8004: 2280 movs r2, #128 ; 0x80 + 8006: 2301 movs r3, #1 + 8008: 2401 movs r4, #1 + 800a: 2500 movs r5, #0 + 800c: 2600 movs r6, #0 + 800e: 2700 movs r7, #0 + +00008010 <[^>]*>: + 8010: 2012 movs r0, #18 + 8012: 2100 movs r1, #0 + 8014: 2281 movs r2, #129 ; 0x81 + 8016: 2320 movs r3, #32 + 8018: 2700 movs r7, #0 + 801a: 2600 movs r6, #0 + 801c: 2581 movs r5, #129 ; 0x81 + 801e: 2422 movs r4, #34 ; 0x22 + +00008020 <[^>]*>: + 8020: 01 .byte 0x01 + +00008021 <[^>]*>: + 8021: 02 .byte 0x02 + +Disassembly of section .far: + +12340000 <[^>]*>: +12340000: 2000 movs r0, #0 +12340002: 2100 movs r1, #0 +12340004: 2200 movs r2, #0 +12340006: 2301 movs r3, #1 |