diff options
author | Yury Norov <ynorov@caviumnetworks.com> | 2017-01-23 17:07:13 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2017-01-23 17:07:13 +0000 |
commit | 2d0ca824112f269a883cd04d344614ccab3baaf4 (patch) | |
tree | 5a55382ca10744fd0cc2d58cf9f4b05c05b9a1c8 /ld | |
parent | c49f9d0fdaea8c2e5f78e20bec113fe3cf1b79f0 (diff) | |
download | gdb-2d0ca824112f269a883cd04d344614ccab3baaf4.zip gdb-2d0ca824112f269a883cd04d344614ccab3baaf4.tar.gz gdb-2d0ca824112f269a883cd04d344614ccab3baaf4.tar.bz2 |
Fix AArch64 relocation handling in ILP32 mode.
bfd * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
ld * testsuite/ld-aarch64/aarch64-elf.exp: Run new tests.
* testsuite/ld-aarch64/tls-desc-ie-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-all-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-gd-le-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-gdesc-le-2-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-gdesc-le-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-ie-le-2-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-ie-le-3-ilp32.d: New test.
* testsuite/ld-aarch64/tls-relax-ie-le-ilp32.d: New test.
* testsuite/ld-aarch64/tls-tiny-desc-ie-ilp32.d: New test.
* testsuite/ld-aarch64/tls-tiny-desc-le-ilp32.d: New test.
* testsuite/ld-aarch64/tls-tiny-gd-ie-ilp32.d: New test.
* testsuite/ld-aarch64/tls-tiny-gd-le-ilp32.d: New test.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 16 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/aarch64-elf.exp | 14 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-desc-ie-ilp32.d | 37 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-relax-all-ilp32.d | 40 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-relax-gd-le-ilp32.d | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-relax-gdesc-le-2-ilp32.d | 19 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-relax-gdesc-le-ilp32.d | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-relax-ie-le-2-ilp32.d | 18 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-relax-ie-le-3-ilp32.d | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-relax-ie-le-ilp32.d | 10 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-tiny-desc-ie-ilp32.d | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-tiny-desc-le-ilp32.d | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-tiny-gd-ie-ilp32.d | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-aarch64/tls-tiny-gd-le-ilp32.d | 12 |
14 files changed, 233 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index 8615343..cf1d670 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,19 @@ +2017-01-23 Yury Norov <ynorov@caviumnetworks.com> + + * testsuite/ld-aarch64/aarch64-elf.exp: Run new tests. + * testsuite/ld-aarch64/tls-desc-ie-ilp32.d: New test. + * testsuite/ld-aarch64/tls-relax-all-ilp32.d: New test. + * testsuite/ld-aarch64/tls-relax-gd-le-ilp32.d: New test. + * testsuite/ld-aarch64/tls-relax-gdesc-le-2-ilp32.d: New test. + * testsuite/ld-aarch64/tls-relax-gdesc-le-ilp32.d: New test. + * testsuite/ld-aarch64/tls-relax-ie-le-2-ilp32.d: New test. + * testsuite/ld-aarch64/tls-relax-ie-le-3-ilp32.d: New test. + * testsuite/ld-aarch64/tls-relax-ie-le-ilp32.d: New test. + * testsuite/ld-aarch64/tls-tiny-desc-ie-ilp32.d: New test. + * testsuite/ld-aarch64/tls-tiny-desc-le-ilp32.d: New test. + * testsuite/ld-aarch64/tls-tiny-gd-ie-ilp32.d: New test. + * testsuite/ld-aarch64/tls-tiny-gd-le-ilp32.d: New test. + 2017-01-23 Nick Clifton <nickc@redhat.com> * po/ga.po: Updated Irish translation. diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp index f77b169..ca21e17 100644 --- a/ld/testsuite/ld-aarch64/aarch64-elf.exp +++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp @@ -213,10 +213,13 @@ run_dump_test "farcall-b-section" run_dump_test "farcall-bl-section" run_dump_test "tls-relax-all" +run_dump_test "tls-relax-all-ilp32" run_dump_test "tls-relax-gd-le" +run_dump_test "tls-relax-gd-le-ilp32" run_dump_test "tls-relax-gdesc-le" -run_dump_test "tls-relax-gd-ie-ilp32" +run_dump_test "tls-relax-gdesc-le-ilp32" run_dump_test "tls-relax-gd-ie" +run_dump_test "tls-relax-gd-ie-ilp32" run_dump_test_lp64 "tls-relax-large-gd-ie" run_dump_test_lp64 "tls-relax-large-gd-ie-be" run_dump_test_lp64 "tls-relax-large-gd-le" @@ -227,21 +230,30 @@ run_dump_test_lp64 "tls-relax-large-desc-le" run_dump_test_lp64 "tls-relax-large-desc-le-be" run_dump_test "tls-relax-gdesc-ie" run_dump_test "tls-relax-ie-le" +run_dump_test "tls-relax-ie-le-ilp32" run_dump_test "tls-relax-ld-le-small" run_dump_test "tls-relax-ld-le-small-ilp32" run_dump_test "tls-relax-ld-le-tiny" run_dump_test "tls-relax-ld-le-tiny-ilp32" run_dump_test "tls-desc-ie" +run_dump_test "tls-desc-ie-ilp32" run_dump_test "tls-relax-gdesc-ie-2" run_dump_test "tls-relax-gdesc-le-2" +run_dump_test "tls-relax-gdesc-le-2-ilp32" run_dump_test "tls-relax-ie-le-2" +run_dump_test "tls-relax-ie-le-2-ilp32" run_dump_test "tls-relax-ie-le-3" +run_dump_test "tls-relax-ie-le-3-ilp32" run_dump_test "tls-tiny-gd" run_dump_test "tls-tiny-gd-ie" +run_dump_test "tls-tiny-gd-ie-ilp32" run_dump_test "tls-tiny-gd-le" +run_dump_test "tls-tiny-gd-le-ilp32" run_dump_test "tls-tiny-desc" run_dump_test "tls-tiny-desc-ie" +run_dump_test "tls-tiny-desc-ie-ilp32" run_dump_test "tls-tiny-desc-le" +run_dump_test "tls-tiny-desc-le-ilp32" run_dump_test "tls-tiny-ie" run_dump_test_lp64 "tls-large-ie" run_dump_test_lp64 "tls-large-ie-be" diff --git a/ld/testsuite/ld-aarch64/tls-desc-ie-ilp32.d b/ld/testsuite/ld-aarch64/tls-desc-ie-ilp32.d new file mode 100644 index 0000000..40680a6 --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-desc-ie-ilp32.d @@ -0,0 +1,37 @@ +#source: tls-desc-ie.s +#as: -mabi=ilp32 +#ld: -shared -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +10000: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +10004: 91002000 add x0, x0, #0x8 + +10008: 94000016 bl 10060 <.*> + +1000c: d503201f nop + +10010: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +10014: b9400400 ldr w0, \[x0, #4\] + +10018: d503201f nop + +1001c: d503201f nop + +10020: d53bd041 mrs x1, tpidr_el0 + +10024: 8b000020 add x0, x1, x0 + +10028: d53bd042 mrs x2, tpidr_el0 + +1002c: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +10030: f9400400 ldr x0, \[x0, #8\] + +10034: 8b000040 add x0, x2, x0 + +10038: b9400000 ldr w0, \[x0\] + +1003c: 0b000020 add w0, w1, w0 + +Disassembly of section .plt: + +00010040 <.plt>: + +10040: a9bf7bf0 stp x16, x30, \[sp, #-16\]! + +10044: 90000090 adrp x16, 20000 <_GLOBAL_OFFSET_TABLE_> + +10048: b9401a11 ldr w17, \[x16, #24\] + +1004c: 11006210 add w16, w16, #0x18 + +10050: d61f0220 br x17 + +10054: d503201f nop + +10058: d503201f nop + +1005c: d503201f nop + +10060: 90000090 adrp x16, 20000 <_GLOBAL_OFFSET_TABLE_> + +10064: b9401e11 ldr w17, \[x16, #28\] + +10068: 11007210 add w16, w16, #0x1c + +1006c: d61f0220 br x17 diff --git a/ld/testsuite/ld-aarch64/tls-relax-all-ilp32.d b/ld/testsuite/ld-aarch64/tls-relax-all-ilp32.d new file mode 100644 index 0000000..1cb4ef4 --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-relax-all-ilp32.d @@ -0,0 +1,40 @@ +#source: tls-relax-all.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +10000: a9bf7bfd stp x29, x30, \[sp, #-16\]! + +10004: 910003fd mov x29, sp + +10008: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +1000c: b9400400 ldr w0, \[x0, #4\] + +10010: d503201f nop + +10014: d503201f nop + +10018: d53bd041 mrs x1, tpidr_el0 + +1001c: 8b000020 add x0, x1, x0 + +10020: b9400001 ldr w1, \[x0\] + +10024: 52a00000 movz w0, #0x0, lsl #16 + +10028: 72800180 movk w0, #0xc + +1002c: d503201f nop + +10030: d503201f nop + +10034: d53bd042 mrs x2, tpidr_el0 + +10038: 8b000040 add x0, x2, x0 + +1003c: b9400000 ldr w0, \[x0\] + +10040: 0b000021 add w1, w1, w0 + +10044: 90000080 adrp x0, 20000 <_GLOBAL_OFFSET_TABLE_> + +10048: b9400800 ldr w0, \[x0, #8\] + +1004c: d53bd041 mrs x1, tpidr_el0 + +10050: 0b000020 add w0, w1, w0 + +10054: b9400000 ldr w0, \[x0\] + +10058: 0b000021 add w1, w1, w0 + +1005c: 52a00000 movz w0, #0x0, lsl #16 + +10060: 72800280 movk w0, #0x14 + +10064: d53bd041 mrs x1, tpidr_el0 + +10068: 0b000020 add w0, w1, w0 + +1006c: b9400000 ldr w0, \[x0\] + +10070: 0b000021 add w1, w1, w0 + +10074: d53bd042 mrs x2, tpidr_el0 + +10078: 52a00000 movz w0, #0x0, lsl #16 + +1007c: 72800300 movk w0, #0x18 + +10080: 8b000040 add x0, x2, x0 + +10084: b9400000 ldr w0, \[x0\] + +10088: 0b000020 add w0, w1, w0 diff --git a/ld/testsuite/ld-aarch64/tls-relax-gd-le-ilp32.d b/ld/testsuite/ld-aarch64/tls-relax-gd-le-ilp32.d new file mode 100644 index 0000000..dd91cb4 --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-relax-gd-le-ilp32.d @@ -0,0 +1,10 @@ +#source: tls-relax-gd-le.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +10000: 52a00000 movz w0, #0x0, lsl #16 + +10004: 72800100 movk w0, #0x8 + +10008: d53bd041 mrs x1, tpidr_el0 + +1000c: 0b000020 add w0, w1, w0 + +10010: b9400000 ldr w0, \[x0\] diff --git a/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-2-ilp32.d b/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-2-ilp32.d new file mode 100644 index 0000000..903b0b4 --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-2-ilp32.d @@ -0,0 +1,19 @@ +#source: tls-relax-gdesc-le-2.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +10000: 52a00000 movz w0, #0x0, lsl #16 + +10004: d503201f nop + +10008: d503201f nop + +1000c: 72800100 movk w0, #0x8 + +10010: d503201f nop + +10014: d503201f nop + +10018: d503201f nop + +1001c: d503201f nop + +10020: d503201f nop + +10024: d503201f nop + +10028: d503201f nop + +1002c: d53bd041 mrs x1, tpidr_el0 + +10030: 8b000020 add x0, x1, x0 + +10034: b9400000 ldr w0, \[x0\] diff --git a/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-ilp32.d b/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-ilp32.d new file mode 100644 index 0000000..020554b --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-ilp32.d @@ -0,0 +1,12 @@ +#source: tls-relax-gdesc-le.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +10000: 52a00000 movz w0, #0x0, lsl #16 + +10004: 72800100 movk w0, #0x8 + +10008: d503201f nop + +1000c: d503201f nop + +10010: d53bd041 mrs x1, tpidr_el0 + +10014: 8b000020 add x0, x1, x0 + +10018: b9400000 ldr w0, \[x0\] diff --git a/ld/testsuite/ld-aarch64/tls-relax-ie-le-2-ilp32.d b/ld/testsuite/ld-aarch64/tls-relax-ie-le-2-ilp32.d new file mode 100644 index 0000000..71ee72c --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-relax-ie-le-2-ilp32.d @@ -0,0 +1,18 @@ +#source: tls-relax-ie-le-2.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +10000: d53bd041 mrs x1, tpidr_el0 + +10004: d503201f nop + +10008: d503201f nop + +1000c: 52a00000 movz w0, #0x0, lsl #16 + +10010: d503201f nop + +10014: d503201f nop + +10018: d503201f nop + +1001c: 72800100 movk w0, #0x8 + +10020: d503201f nop + +10024: 8b000020 add x0, x1, x0 + +10028: d503201f nop + +1002c: d503201f nop + +10030: b9400000 ldr w0, \[x0\] diff --git a/ld/testsuite/ld-aarch64/tls-relax-ie-le-3-ilp32.d b/ld/testsuite/ld-aarch64/tls-relax-ie-le-3-ilp32.d new file mode 100644 index 0000000..e0bc05d --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-relax-ie-le-3-ilp32.d @@ -0,0 +1,10 @@ +#source: tls-relax-ie-le-3.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +10000: d53bd042 mrs x2, tpidr_el0 + +10004: 52a0000f movz w15, #0x0, lsl #16 + +10008: 7280010f movk w15, #0x8 + +1000c: 8b0f004f add x15, x2, x15 + +10010: b94001e0 ldr w0, \[x15\] diff --git a/ld/testsuite/ld-aarch64/tls-relax-ie-le-ilp32.d b/ld/testsuite/ld-aarch64/tls-relax-ie-le-ilp32.d new file mode 100644 index 0000000..ede3d8c --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-relax-ie-le-ilp32.d @@ -0,0 +1,10 @@ +#source: tls-relax-ie-le.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +10000: d53bd041 mrs x1, tpidr_el0 + +10004: 52a00000 movz w0, #0x0, lsl #16 + +10008: 72800100 movk w0, #0x8 + +1000c: 8b000020 add x0, x1, x0 + +10010: b9400000 ldr w0, \[x0\] diff --git a/ld/testsuite/ld-aarch64/tls-tiny-desc-ie-ilp32.d b/ld/testsuite/ld-aarch64/tls-tiny-desc-ie-ilp32.d new file mode 100644 index 0000000..ebbaf85 --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-tiny-desc-ie-ilp32.d @@ -0,0 +1,12 @@ +#source: tls-tiny-desc-ie.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +Disassembly of section .text: + +00010000 \<test\>: + +10000: 18080020 ldr w0, 20004 \<_GLOBAL_OFFSET_TABLE_\+0x4\> + +10004: d503201f nop + +10008: d503201f nop diff --git a/ld/testsuite/ld-aarch64/tls-tiny-desc-le-ilp32.d b/ld/testsuite/ld-aarch64/tls-tiny-desc-le-ilp32.d new file mode 100644 index 0000000..79a6f5c --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-tiny-desc-le-ilp32.d @@ -0,0 +1,12 @@ +#source: tls-tiny-desc-le.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +Disassembly of section .text: + +00010000 \<test\>: + +10000: 52a00000 movz w0, #0x0, lsl #16 + +10004: 72800100 movk w0, #0x8 + +10008: d503201f nop diff --git a/ld/testsuite/ld-aarch64/tls-tiny-gd-ie-ilp32.d b/ld/testsuite/ld-aarch64/tls-tiny-gd-ie-ilp32.d new file mode 100644 index 0000000..1ea6110 --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-tiny-gd-ie-ilp32.d @@ -0,0 +1,12 @@ +#source: tls-tiny-gd-ie.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +Disassembly of section .text: + +00010000 \<test\>: + +10000: 18080020 ldr w0, 20004 \<_GLOBAL_OFFSET_TABLE_\+0x4\> + +10004: d53bd041 mrs x1, tpidr_el0 + +10008: 0b000020 add w0, w1, w0 diff --git a/ld/testsuite/ld-aarch64/tls-tiny-gd-le-ilp32.d b/ld/testsuite/ld-aarch64/tls-tiny-gd-le-ilp32.d new file mode 100644 index 0000000..5213a04 --- /dev/null +++ b/ld/testsuite/ld-aarch64/tls-tiny-gd-le-ilp32.d @@ -0,0 +1,12 @@ +#source: tls-tiny-gd-le.s +#as: -mabi=ilp32 +#ld: -m [aarch64_choose_ilp32_emul] -T relocs-ilp32.ld -e0 +#objdump: -dr +#... + +Disassembly of section .text: + +00010000 \<test\>: + +10000: d53bd041 mrs x1, tpidr_el0 + +10004: 11400020 add w0, w1, #0x0, lsl #12 + +10008: 11002000 add w0, w0, #0x8 |