Browse Source
2015-08-19 Jiong Wang <jiong.wang@arm.com> bfd/ PR ld/18276 * elfnn-aarch64.c (IS_AARCH64_TLS_RELOC): Recognize new relocation types, including BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12, BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0, BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC, BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1, BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC, BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2. (elfNN_aarch64_final_link_relocate): Likewise. * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise. (_bfd_aarch64_elf_resolve_relocation): Likewise. ld/testsuite/ * ld-aarch64/emit-relocs-87.s: New testcase. * ld-aarch64/emit-relocs-88.s: Likewise. * ld-aarch64/emit-relocs-88-overflow.s: Likewise. * ld-aarch64/emit-relocs-89.s: Likewise. * ld-aarch64/emit-relocs-90.s: Likewise. * ld-aarch64/emit-relocs-90-overflow.s: Likewise. * ld-aarch64/emit-relocs-523.s: Likewise. * ld-aarch64/emit-relocs-524.s: Likewise. * ld-aarch64/emit-relocs-525.s: Likewise. * ld-aarch64/emit-relocs-527.s: Likewise. * ld-aarch64/emit-relocs-526.s: Likewise. * ld-aarch64/emit-relocs-528.s: Likewise. * ld-aarch64/emit-relocs-528-overflow.s: Likewise. * ld-aarch64/emit-relocs-87.d: New expectation file. * ld-aarch64/emit-relocs-88.d: Likewise. * ld-aarch64/emit-relocs-88-overflow.d: Likewise. * ld-aarch64/emit-relocs-89.d: Likewise. * ld-aarch64/emit-relocs-90.d: Likewise. * ld-aarch64/emit-relocs-90-overflow.d: Likewise. * ld-aarch64/emit-relocs-91.d: Likewise. * ld-aarch64/emit-relocs-523.d: Likewise. * ld-aarch64/emit-relocs-524.d: Likewise. * ld-aarch64/emit-relocs-525.d: Likewise. * ld-aarch64/emit-relocs-526.d: Likewise. * ld-aarch64/emit-relocs-527.d: Likewise. * ld-aarch64/emit-relocs-528.d: Likewise. * ld-aarch64/emit-relocs-528-overflow.d: Likewise. * ld-aarch64/aarch64-elf.exp: Run new testcases.users/ARM/embedded-binutils-2_26-branch
33 changed files with 322 additions and 0 deletions
@ -0,0 +1,7 @@ |
|||
#source: emit-relocs-523.s |
|||
#ld: -T relocs.ld -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#... |
|||
0000000000010000 <.text>: |
|||
10000: f2c0001d movk x29, #0x0, lsl #32 |
|||
10000: R_AARCH64_TLSLD_MOVW_DTPREL_G2 v2 |
|||
@ -0,0 +1,11 @@ |
|||
.global v1 |
|||
.size v1, 65536 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.zero 65536 |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
movk x29, #:dtprel_g2:v2 |
|||
@ -0,0 +1,7 @@ |
|||
#source: emit-relocs-524.s |
|||
#ld: -T relocs.ld -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#... |
|||
0000000000010000 <.text>: |
|||
10000: f2a0003d movk x29, #0x1, lsl #16 |
|||
10000: R_AARCH64_TLSLD_MOVW_DTPREL_G1 v2 |
|||
@ -0,0 +1,11 @@ |
|||
.global v1 |
|||
.size v1, 65536 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.zero 65536 |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
movk x29, #:dtprel_g1:v2 |
|||
@ -0,0 +1,7 @@ |
|||
#source: emit-relocs-525.s |
|||
#ld: -T relocs.ld -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#... |
|||
0000000000010000 <.text>: |
|||
10000: f2a00031 movk x17, #0x1, lsl #16 |
|||
10000: R_AARCH64_TLSLD_MOVW_DTPREL_G1_NC v2 |
|||
@ -0,0 +1,11 @@ |
|||
.global v1 |
|||
.size v1, 65536 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.zero 65536 |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
movk x17, #:dtprel_g1_nc:v2 |
|||
@ -0,0 +1,4 @@ |
|||
#source: emit-relocs-526-overflow.s |
|||
#ld: -T relocs.ld -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#error: .*\(.text\+0x\d+\): relocation truncated to fit: R_AARCH64_TLSLD_MOVW_DTPREL_G0 against symbol `v2' .* |
|||
@ -0,0 +1,10 @@ |
|||
.global v1 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.zero 65536 |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
movk x17, #:dtprel_g0:v2 |
|||
@ -0,0 +1,7 @@ |
|||
#source: emit-relocs-526.s |
|||
#ld: -T relocs.ld -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#... |
|||
0000000000010000 <.text>: |
|||
10000: f2800091 movk x17, #0x4 |
|||
10000: R_AARCH64_TLSLD_MOVW_DTPREL_G0 v2 |
|||
@ -0,0 +1,10 @@ |
|||
.global v1 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.word 0xdeaddead |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
movk x17, #:dtprel_g0:v2 |
|||
@ -0,0 +1,7 @@ |
|||
#source: emit-relocs-527.s |
|||
#ld: -T relocs.ld -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#... |
|||
0000000000010000 <.text>: |
|||
10000: f2800091 movk x17, #0x4 |
|||
10000: R_AARCH64_TLSLD_MOVW_DTPREL_G0_NC v2 |
|||
@ -0,0 +1,10 @@ |
|||
.global v1 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.word 0xdeaddead |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
movk x17, #:dtprel_g0_nc:v2 |
|||
@ -0,0 +1,4 @@ |
|||
#source: emit-relocs-528-overflow.s |
|||
#ld: -T relocs.ld -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#error: .*\(.text\+0x\d+\): relocation truncated to fit: R_AARCH64_TLSLD_ADD_DTPREL_HI12 against symbol `v2' .* |
|||
@ -0,0 +1,11 @@ |
|||
.global v1 |
|||
.size v1, 16777216 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.zero 16777216 |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
add x20, x9, #:dtprel_hi12:v2 |
|||
@ -0,0 +1,7 @@ |
|||
#source: emit-relocs-528.s |
|||
#ld: -T relocs.ld -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#... |
|||
0000000000010000 <.text>: |
|||
10000: 91002934 add x20, x9, #0xa |
|||
10000: R_AARCH64_TLSLD_ADD_DTPREL_HI12 v2 |
|||
@ -0,0 +1,11 @@ |
|||
.global v1 |
|||
.size v1, 40960 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.zero 40960 |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
add x20, x9, #:dtprel_hi12:v2 |
|||
@ -0,0 +1,8 @@ |
|||
#source: emit-relocs-87.s |
|||
#as: -mabi=ilp32 |
|||
#ld: -m [aarch64_choose_ilp32_emul] -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#... |
|||
.* <.text>: |
|||
.*: f2a00015 movk x21, #0x0, lsl #16 |
|||
.*: R_AARCH64_P32_TLSLD_MOVW_DTPREL_G1 v1 |
|||
@ -0,0 +1,10 @@ |
|||
.global v1 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.word 0xdeaddead |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
movk x21, #:dtprel_g1:v1 |
|||
@ -0,0 +1,5 @@ |
|||
#source: emit-relocs-88-overflow.s |
|||
#as: -mabi=ilp32 |
|||
#ld: -m [aarch64_choose_ilp32_emul] -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#error: .*\(.text\+0x\d+\): relocation truncated to fit: R_AARCH64_P32_TLSLD_MOVW_DTPREL_G0 against symbol `v2' .* |
|||
@ -0,0 +1,10 @@ |
|||
.global v1 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.zero 65536 |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
movk x21, #:dtprel_g0:v2 |
|||
@ -0,0 +1,8 @@ |
|||
#source: emit-relocs-88.s |
|||
#as: -mabi=ilp32 |
|||
#ld: -m [aarch64_choose_ilp32_emul] -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#... |
|||
.* <.text>: |
|||
.*: f2800015 movk x21, #0x0 |
|||
.*: R_AARCH64_P32_TLSLD_MOVW_DTPREL_G0 v1 |
|||
@ -0,0 +1,10 @@ |
|||
.global v1 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.word 0xdeaddead |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
movk x21, #:dtprel_g0:v1 |
|||
@ -0,0 +1,8 @@ |
|||
#source: emit-relocs-89.s |
|||
#as: -mabi=ilp32 |
|||
#ld: -m [aarch64_choose_ilp32_emul] -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#... |
|||
.* <.text>: |
|||
.*: f2800015 movk x21, #0x0 |
|||
.*: R_AARCH64_P32_TLSLD_MOVW_DTPREL_G0_NC v1 |
|||
@ -0,0 +1,10 @@ |
|||
.global v1 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.word 0xdeaddead |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
movk x21, #:dtprel_g0_nc:v1 |
|||
@ -0,0 +1,5 @@ |
|||
#source: emit-relocs-90-overflow.s |
|||
#as: -mabi=ilp32 |
|||
#ld: -m [aarch64_choose_ilp32_emul] -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#error: .*\(.text\+0x\d+\): relocation truncated to fit: R_AARCH64_P32_TLSLD_ADD_DTPREL_HI12 against symbol `v2' .* |
|||
@ -0,0 +1,11 @@ |
|||
.global v1 |
|||
.size v1, 16777216 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.zero 16777216 |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
add w20, w9, #:dtprel_hi12:v2 |
|||
@ -0,0 +1,8 @@ |
|||
#source: emit-relocs-90.s |
|||
#as: -mabi=ilp32 |
|||
#ld: -m [aarch64_choose_ilp32_emul] -e0 --emit-relocs |
|||
#objdump: -dr |
|||
#... |
|||
.* <.text>: |
|||
.*: 11019134 add w20, w9, #0x64 |
|||
.*: R_AARCH64_P32_TLSLD_ADD_DTPREL_HI12 v2 |
|||
@ -0,0 +1,11 @@ |
|||
.global v1 |
|||
.size v1, 409600 |
|||
.global v2 |
|||
.section .tdata,"awT",%progbits |
|||
v1: |
|||
.zero 409600 |
|||
v2: |
|||
.word 0xcafecafe |
|||
|
|||
.text |
|||
add w20, w9, #:dtprel_hi12:v2 |
|||
Loading…
Reference in new issue