aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorRenlin Li <renlin.li@arm.com>2015-10-02 17:22:36 +0100
committerRenlin Li <renlin.li@arm.com>2015-10-02 17:56:09 +0100
commitac734732481451698ee23990aaa64907e56dd082 (patch)
tree22387bf9cc94b8cbb190e1b08e20ee4d954b2dd0 /ld
parentb7a944fea3a0194d81f6de4d958f3a1d2c6ad03a (diff)
downloadgdb-ac734732481451698ee23990aaa64907e56dd082.zip
gdb-ac734732481451698ee23990aaa64907e56dd082.tar.gz
gdb-ac734732481451698ee23990aaa64907e56dd082.tar.bz2
[BFD][AARCH64]Add TLSGD relaxation support under large memory model.
bfd/ 2015-10-02 Renlin Li <renlin.li@arm.com> * elfnn-aarch64.c(IS_AARCH64_TLS_RELAX_RELOC): Add relaxation support for TLSGD_MOVW_G0_NC and TLSGD_MOVW_G1. (aarch64_tls_transition_without_check): Likewise (elfNN_aarch64_tls_relax): Likwise. ld/testsuite/ 2015-10-02 Renlin Li <renlin.li@arm.com> * ld-aarch64/aarch64-elf.exp: run new test * ld-aarch64/tls-relax-large-gd-ie.d: New. * ld-aarch64/tls-relax-large-gd-ie.s: New. * ld-aarch64/tls-relax-large-gd-le.d: New. * ld-aarch64/tls-relax-large-gd-le.s: New.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ChangeLog8
-rw-r--r--ld/testsuite/ld-aarch64/aarch64-elf.exp2
-rw-r--r--ld/testsuite/ld-aarch64/tls-relax-large-gd-ie.d16
-rw-r--r--ld/testsuite/ld-aarch64/tls-relax-large-gd-ie.s20
-rw-r--r--ld/testsuite/ld-aarch64/tls-relax-large-gd-le.d16
-rw-r--r--ld/testsuite/ld-aarch64/tls-relax-large-gd-le.s19
6 files changed, 81 insertions, 0 deletions
diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
index e486bba..a95de8c 100644
--- a/ld/testsuite/ChangeLog
+++ b/ld/testsuite/ChangeLog
@@ -1,5 +1,13 @@
2015-10-02 Renlin Li <renlin.li@arm.com>
+ * ld-aarch64/aarch64-elf.exp: run new test
+ * ld-aarch64/tls-relax-large-gd-ie.d: New.
+ * ld-aarch64/tls-relax-large-gd-ie.s: New.
+ * ld-aarch64/tls-relax-large-gd-le.d: New.
+ * ld-aarch64/tls-relax-large-gd-le.s: New.
+
+2015-10-02 Renlin Li <renlin.li@arm.com>
+
* ld-aarch64/tls-large-ie.d: New.
* ld-aarch64/tls-large-ie.s: New.
* ld-aarch64/aarch64-elf.exp: Run new test.
diff --git a/ld/testsuite/ld-aarch64/aarch64-elf.exp b/ld/testsuite/ld-aarch64/aarch64-elf.exp
index d0da92f..f51de9c 100644
--- a/ld/testsuite/ld-aarch64/aarch64-elf.exp
+++ b/ld/testsuite/ld-aarch64/aarch64-elf.exp
@@ -181,6 +181,8 @@ run_dump_test "tls-relax-all"
run_dump_test "tls-relax-gd-le"
run_dump_test "tls-relax-gdesc-le"
run_dump_test "tls-relax-gd-ie"
+run_dump_test "tls-relax-large-gd-ie"
+run_dump_test "tls-relax-large-gd-le"
run_dump_test "tls-relax-gdesc-ie"
run_dump_test "tls-relax-ie-le"
run_dump_test "tls-relax-ld-le-small"
diff --git a/ld/testsuite/ld-aarch64/tls-relax-large-gd-ie.d b/ld/testsuite/ld-aarch64/tls-relax-large-gd-ie.d
new file mode 100644
index 0000000..f3407ef
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/tls-relax-large-gd-ie.d
@@ -0,0 +1,16 @@
+#source: tls-relax-large-gd-ie.s
+#ld: -T relocs.ld -e0
+#objdump: -dr
+#...
+0000000000010000 <test>:
+ +10000: 58000121 ldr x1, 10024 <test\+0x24>
+ +10004: 10000102 adr x2, 10024 <test\+0x24>
+ +10008: 8b010041 add x1, x2, x1
+ +1000c: d2a00000 movz x0, #0x0, lsl #16
+ +10010: f2800100 movk x0, #0x8
+ +10014: 58000000 ldr x0, 10014 <test\+0x14>
+ +10018: d53bd041 mrs x1, tpidr_el0
+ +1001c: 8b000020 add x0, x1, x0
+ +10020: b9400000 ldr w0, \[x0\]
+ +10024: 0000ffdc .word 0x0000ffdc
+ +10028: 00000000 .word 0x00000000
diff --git a/ld/testsuite/ld-aarch64/tls-relax-large-gd-ie.s b/ld/testsuite/ld-aarch64/tls-relax-large-gd-ie.s
new file mode 100644
index 0000000..8e0310d
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/tls-relax-large-gd-ie.s
@@ -0,0 +1,20 @@
+ .global var
+ .section .tdata,"awT",%progbits
+var:
+ .word 2
+
+ .text
+test:
+ ldr x1, .Lgot
+ adr x2, .Lgot
+ add x1, x2, x1
+
+ movz x0, #:tlsgd_g1:var
+ movk x0, #:tlsgd_g0_nc:var
+ add x0, x1, x0
+ bl __tls_get_addr
+ nop
+ ldr w0, [x0]
+
+.Lgot:
+ .dword _GLOBAL_OFFSET_TABLE_ - .
diff --git a/ld/testsuite/ld-aarch64/tls-relax-large-gd-le.d b/ld/testsuite/ld-aarch64/tls-relax-large-gd-le.d
new file mode 100644
index 0000000..acaea58
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/tls-relax-large-gd-le.d
@@ -0,0 +1,16 @@
+#source: tls-relax-large-gd-le.s
+#ld: -T relocs.ld -e0
+#objdump: -dr
+#...
+0000000000010000 <test>:
+ +10000: 58000121 ldr x1, 10024 <test\+0x24>
+ +10004: 10000102 adr x2, 10024 <test\+0x24>
+ +10008: 8b010041 add x1, x2, x1
+ +1000c: d2c00000 movz x0, #0x0, lsl #32
+ +10010: f2a00000 movk x0, #0x0, lsl #16
+ +10014: f2800200 movk x0, #0x10
+ +10018: d53bd041 mrs x1, tpidr_el0
+ +1001c: 8b000020 add x0, x1, x0
+ +10020: b9400000 ldr w0, \[x0\]
+ +10024: 0000ffdc .word 0x0000ffdc
+ +10028: 00000000 .word 0x00000000
diff --git a/ld/testsuite/ld-aarch64/tls-relax-large-gd-le.s b/ld/testsuite/ld-aarch64/tls-relax-large-gd-le.s
new file mode 100644
index 0000000..781f6cc
--- /dev/null
+++ b/ld/testsuite/ld-aarch64/tls-relax-large-gd-le.s
@@ -0,0 +1,19 @@
+ .section .tdata
+var:
+ .word 2
+
+ .text
+test:
+ ldr x1, .Lgot
+ adr x2, .Lgot
+ add x1, x2, x1
+
+ movz x0, #:tlsgd_g1:var
+ movk x0, #:tlsgd_g0_nc:var
+ add x0, x1, x0
+ bl __tls_get_addr
+ nop
+ ldr w0, [x0]
+
+.Lgot:
+ .dword _GLOBAL_OFFSET_TABLE_ - .