[LD][AARCH64]Add test cases for big-endian.

ld/testsuite

2015-11-03  Renlin Li  <renlin.li@arm.com>

	* ld-aarch64/aarch64-elf.exp: Run newly added test cases.
	* ld-aarch64/emit-relocs-301.d: Skip aarch64_be.
	* ld-aarch64/emit-relocs-302.d: Likwise.
	* ld-aarch64/emit-relocs-310.d: Likwise.
	* ld-aarch64/emit-relocs-515.d: Likwise.
	* ld-aarch64/emit-relocs-516.d: Likwise.
	* ld-aarch64/tls-large-desc.d: Likwise.
	* ld-aarch64/tls-large-ie.d: Likwise.
	* ld-aarch64/tls-relax-large-desc-ie.d: Likwise.
	* ld-aarch64/tls-relax-large-desc-le.d: Likwise.
	* ld-aarch64/tls-relax-large-gd-ie.d: Likwise.
	* ld-aarch64/tls-relax-large-gd-le.d: Likwise.
	* ld-aarch64/emit-relocs-301-be.d: New for aarch64_be.
	* ld-aarch64/emit-relocs-302-be.d: Likewise.
	* ld-aarch64/emit-relocs-310-be.d: Likewise.
	* ld-aarch64/emit-relocs-515-be.d: Likewise.
	* ld-aarch64/emit-relocs-516-be.d: Likewise.
	* ld-aarch64/tls-large-desc-be.d: Likewise.
	* ld-aarch64/tls-large-ie-be.d: Likewise.
	* ld-aarch64/tls-relax-large-desc-ie-be.d: Likewise.
	* ld-aarch64/tls-relax-large-desc-le-be.d: Likewise.
	* ld-aarch64/tls-relax-large-gd-ie-be.d: Likewise.
	* ld-aarch64/tls-relax-large-gd-le-be.d: Likewise.
This commit is contained in:
Renlin Li
2015-11-03 12:00:10 +00:00
parent d5f0636bf6
commit 1ac688f831
24 changed files with 316 additions and 0 deletions

View File

@ -1,3 +1,29 @@
2015-11-03 Renlin Li <renlin.li@arm.com>
* ld-aarch64/aarch64-elf.exp: Run newly added test cases.
* ld-aarch64/emit-relocs-301.d: Skip aarch64_be.
* ld-aarch64/emit-relocs-302.d: Likwise.
* ld-aarch64/emit-relocs-310.d: Likwise.
* ld-aarch64/emit-relocs-515.d: Likwise.
* ld-aarch64/emit-relocs-516.d: Likwise.
* ld-aarch64/tls-large-desc.d: Likwise.
* ld-aarch64/tls-large-ie.d: Likwise.
* ld-aarch64/tls-relax-large-desc-ie.d: Likwise.
* ld-aarch64/tls-relax-large-desc-le.d: Likwise.
* ld-aarch64/tls-relax-large-gd-ie.d: Likwise.
* ld-aarch64/tls-relax-large-gd-le.d: Likwise.
* ld-aarch64/emit-relocs-301-be.d: New for aarch64_be.
* ld-aarch64/emit-relocs-302-be.d: Likewise.
* ld-aarch64/emit-relocs-310-be.d: Likewise.
* ld-aarch64/emit-relocs-515-be.d: Likewise.
* ld-aarch64/emit-relocs-516-be.d: Likewise.
* ld-aarch64/tls-large-desc-be.d: Likewise.
* ld-aarch64/tls-large-ie-be.d: Likewise.
* ld-aarch64/tls-relax-large-desc-ie-be.d: Likewise.
* ld-aarch64/tls-relax-large-desc-le-be.d: Likewise.
* ld-aarch64/tls-relax-large-gd-ie-be.d: Likewise.
* ld-aarch64/tls-relax-large-gd-le-be.d: Likewise.
2015-10-29 H.J. Lu <hongjiu.lu@intel.com> 2015-10-29 H.J. Lu <hongjiu.lu@intel.com>
* ld-x86-64/plt-main3.rd: Also check GOTPCRELX. * ld-x86-64/plt-main3.rd: Also check GOTPCRELX.

View File

@ -118,18 +118,23 @@ run_dump_test "emit-relocs-286-bad"
run_dump_test "emit-relocs-299" run_dump_test "emit-relocs-299"
# 300 is not done yet # 300 is not done yet
run_dump_test "emit-relocs-301" run_dump_test "emit-relocs-301"
run_dump_test "emit-relocs-301-be"
run_dump_test "emit-relocs-302" run_dump_test "emit-relocs-302"
run_dump_test "emit-relocs-302-be"
# 303-308 are not done yet # 303-308 are not done yet
run_dump_test "emit-relocs-309-up" run_dump_test "emit-relocs-309-up"
run_dump_test "emit-relocs-309-low" run_dump_test "emit-relocs-309-low"
run_dump_test "emit-relocs-309-up-bad" run_dump_test "emit-relocs-309-up-bad"
run_dump_test "emit-relocs-309-low-bad" run_dump_test "emit-relocs-309-low-bad"
run_dump_test "emit-relocs-310" run_dump_test "emit-relocs-310"
run_dump_test "emit-relocs-310-be"
run_dump_test "emit-relocs-311" run_dump_test "emit-relocs-311"
run_dump_test "emit-relocs-312" run_dump_test "emit-relocs-312"
run_dump_test "emit-relocs-313" run_dump_test "emit-relocs-313"
run_dump_test "emit-relocs-515" run_dump_test "emit-relocs-515"
run_dump_test "emit-relocs-515-be"
run_dump_test "emit-relocs-516" run_dump_test "emit-relocs-516"
run_dump_test "emit-relocs-516-be"
run_dump_test "emit-relocs-523" run_dump_test "emit-relocs-523"
run_dump_test "emit-relocs-524" run_dump_test "emit-relocs-524"
run_dump_test "emit-relocs-525" run_dump_test "emit-relocs-525"
@ -182,9 +187,13 @@ run_dump_test "tls-relax-gd-le"
run_dump_test "tls-relax-gdesc-le" run_dump_test "tls-relax-gdesc-le"
run_dump_test "tls-relax-gd-ie" run_dump_test "tls-relax-gd-ie"
run_dump_test "tls-relax-large-gd-ie" run_dump_test "tls-relax-large-gd-ie"
run_dump_test "tls-relax-large-gd-ie-be"
run_dump_test "tls-relax-large-gd-le" run_dump_test "tls-relax-large-gd-le"
run_dump_test "tls-relax-large-gd-le-be"
run_dump_test "tls-relax-large-desc-ie" run_dump_test "tls-relax-large-desc-ie"
run_dump_test "tls-relax-large-desc-ie-be"
run_dump_test "tls-relax-large-desc-le" run_dump_test "tls-relax-large-desc-le"
run_dump_test "tls-relax-large-desc-le-be"
run_dump_test "tls-relax-large-ie-le" run_dump_test "tls-relax-large-ie-le"
run_dump_test "tls-relax-gdesc-ie" run_dump_test "tls-relax-gdesc-ie"
run_dump_test "tls-relax-ie-le" run_dump_test "tls-relax-ie-le"
@ -203,7 +212,9 @@ run_dump_test "tls-tiny-desc-ie"
run_dump_test "tls-tiny-desc-le" run_dump_test "tls-tiny-desc-le"
run_dump_test "tls-tiny-ie" run_dump_test "tls-tiny-ie"
run_dump_test "tls-large-ie" run_dump_test "tls-large-ie"
run_dump_test "tls-large-ie-be"
run_dump_test "tls-large-desc" run_dump_test "tls-large-desc"
run_dump_test "tls-large-desc-be"
run_dump_test "tls-tiny-ld" run_dump_test "tls-tiny-ld"
run_dump_test "tls-small-ld" run_dump_test "tls-small-ld"
run_dump_test "tlsle" run_dump_test "tlsle"

View File

@ -0,0 +1,23 @@
#source: emit-relocs-301.s
#ld: -T relocs.ld --defsym globala=0x11000 --defsym globalb=0x45000 --defsym globalc=0x1234 -e0 --emit-relocs
#notarget: aarch64-*-*
#objdump: -dr
.*: +file format .*
Disassembly of section .text:
0000000000010000 <\.text>:
10000: 580000e1 ldr x1, 1001c <\.text\+0x1c>
10004: 100000c2 adr x2, 1001c <\.text\+0x1c>
10008: 8b010041 add x1, x2, x1
1000c: f2800200 movk x0, #0x10
1000c: R_AARCH64_MOVW_GOTOFF_G0_NC globala
10010: f2800300 movk x0, #0x18
10010: R_AARCH64_MOVW_GOTOFF_G0_NC globalb
10014: f2800100 movk x0, #0x8
10014: R_AARCH64_MOVW_GOTOFF_G0_NC globalc
10018: f8606820 ldr x0, \[x1,x0\]
1001c: 00000000 \.word 0x00000000
1001c: R_AARCH64_PREL64 _GLOBAL_OFFSET_TABLE_
10020: 0000ffe4 \.word 0x0000ffe4

View File

@ -1,5 +1,6 @@
#source: emit-relocs-301.s #source: emit-relocs-301.s
#ld: -T relocs.ld --defsym globala=0x11000 --defsym globalb=0x45000 --defsym globalc=0x1234 -e0 --emit-relocs #ld: -T relocs.ld --defsym globala=0x11000 --defsym globalb=0x45000 --defsym globalc=0x1234 -e0 --emit-relocs
#notarget: aarch64_be-*-*
#objdump: -dr #objdump: -dr
.*: +file format .* .*: +file format .*

View File

@ -0,0 +1,23 @@
#source: emit-relocs-302.s
#ld: -T relocs.ld --defsym globala=0x11000 --defsym globalb=0x45000 --defsym globalc=0x1234 -e0 --emit-relocs
#notarget: aarch64-*-*
#objdump: -dr
.*: +file format .*
Disassembly of section .text:
0000000000010000 <\.text>:
10000: 580000e1 ldr x1, 1001c <\.text\+0x1c>
10004: 100000c2 adr x2, 1001c <\.text\+0x1c>
10008: 8b010041 add x1, x2, x1
1000c: d2a00000 movz x0, #0x0, lsl #16
1000c: R_AARCH64_MOVW_GOTOFF_G1 globala
10010: d2a00000 movz x0, #0x0, lsl #16
10010: R_AARCH64_MOVW_GOTOFF_G1 globalb
10014: d2a00000 movz x0, #0x0, lsl #16
10014: R_AARCH64_MOVW_GOTOFF_G1 globalc
10018: f8606820 ldr x0, \[x1,x0\]
1001c: 00000000 \.word 0x00000000
1001c: R_AARCH64_PREL64 _GLOBAL_OFFSET_TABLE_
10020: 0000ffe4 \.word 0x0000ffe4

View File

@ -1,5 +1,6 @@
#source: emit-relocs-302.s #source: emit-relocs-302.s
#ld: -T relocs.ld --defsym globala=0x11000 --defsym globalb=0x45000 --defsym globalc=0x1234 -e0 --emit-relocs #ld: -T relocs.ld --defsym globala=0x11000 --defsym globalb=0x45000 --defsym globalc=0x1234 -e0 --emit-relocs
#notarget: aarch64_be-*-*
#objdump: -dr #objdump: -dr
.*: +file format .* .*: +file format .*

View File

@ -0,0 +1,22 @@
#source: emit-relocs-310.s
#ld: -T relocs.ld --defsym globala=0x11000 --defsym globalb=0x45000 --defsym globalc=0x1234 -e0 --emit-relocs
#notarget: aarch64-*-*
#objdump: -dr
.*: +file format .*
Disassembly of section .text:
0000000000010000 <\.text>:
10000: 580000c1 ldr x1, 10018 <\.text\+0x18>
10004: 100000a2 adr x2, 10018 <\.text\+0x18>
10008: 8b010041 add x1, x2, x1
1000c: f9400820 ldr x0, \[x1,#16\]
1000c: R_AARCH64_LD64_GOTOFF_LO15 globala
10010: f9400c20 ldr x0, \[x1,#24\]
10010: R_AARCH64_LD64_GOTOFF_LO15 globalb
10014: f9400420 ldr x0, \[x1,#8\]
10014: R_AARCH64_LD64_GOTOFF_LO15 globalc
10018: 00000000 .word 0x00000000
10018: R_AARCH64_PREL64 _GLOBAL_OFFSET_TABLE_
1001c: 0000ffe8 .word 0x0000ffe8

View File

@ -1,5 +1,6 @@
#source: emit-relocs-310.s #source: emit-relocs-310.s
#ld: -T relocs.ld --defsym globala=0x11000 --defsym globalb=0x45000 --defsym globalc=0x1234 -e0 --emit-relocs #ld: -T relocs.ld --defsym globala=0x11000 --defsym globalb=0x45000 --defsym globalc=0x1234 -e0 --emit-relocs
#notarget: aarch64_be-*-*
#objdump: -dr #objdump: -dr
.*: +file format .* .*: +file format .*

View File

@ -0,0 +1,34 @@
#source: emit-relocs-515.s
#ld: -shared -T relocs.ld -e0
#notarget: aarch64-*-*
#objdump: -dr
#...
Disassembly of section .text:
0000000000010000 \<test\>:
10000: 580000e1 ldr x1, 1001c \<test\+0x1c\>
10004: 100000c2 adr x2, 1001c \<test\+0x1c\>
10008: 8b020021 add x1, x1, x2
1000c: d2a00000 movz x0, #0x0, lsl #16
10010: 8b000020 add x0, x1, x0
10014: 9400000c bl 10044 \<test\+0x44\>
10018: d503201f nop
1001c: 00000000 .word 0x00000000
10020: 0000ffe4 .word 0x0000ffe4
Disassembly of section .plt:
0000000000010024 \<.plt\>:
10024: a9bf7bf0 stp x16, x30, \[sp,#-16\]!
10028: 90000090 adrp x16, 20000 \<_GLOBAL_OFFSET_TABLE_\>
1002c: f9401611 ldr x17, \[x16,#40\]
10030: 9100a210 add x16, x16, #0x28
10034: d61f0220 br x17
10038: d503201f nop
1003c: d503201f nop
10040: d503201f nop
10044: 90000090 adrp x16, 20000 \<_GLOBAL_OFFSET_TABLE_\>
10048: f9401a11 ldr x17, \[x16,#48\]
1004c: 9100c210 add x16, x16, #0x30
10050: d61f0220 br x17

View File

@ -1,5 +1,6 @@
#source: emit-relocs-515.s #source: emit-relocs-515.s
#ld: -shared -T relocs.ld -e0 #ld: -shared -T relocs.ld -e0
#notarget: aarch64_be-*-*
#objdump: -dr #objdump: -dr
#... #...

View File

@ -0,0 +1,35 @@
#source: emit-relocs-516.s
#ld: -shared -T relocs.ld -e0
#notarget: aarch64-*-*
#objdump: -dr
#...
Disassembly of section .text:
0000000000010000 \<test\>:
10000: 58000101 ldr x1, 10020 \<test\+0x20\>
10004: 100000e2 adr x2, 10020 \<test\+0x20\>
10008: 8b020021 add x1, x1, x2
1000c: f2800100 movk x0, #0x8
10010: f2800300 movk x0, #0x18
10014: 8b000020 add x0, x1, x0
10018: 9400000c bl 10048 \<test\+0x48\>
1001c: d503201f nop
10020: 00000000 .word 0x00000000
10024: 0000ffe0 .word 0x0000ffe0
Disassembly of section .plt:
0000000000010028 \<.plt\>:
10028: a9bf7bf0 stp x16, x30, \[sp,#-16\]!
1002c: 90000090 adrp x16, 20000 \<_GLOBAL_OFFSET_TABLE_\>
10030: f9401e11 ldr x17, \[x16,#56\]
10034: 9100e210 add x16, x16, #0x38
10038: d61f0220 br x17
1003c: d503201f nop
10040: d503201f nop
10044: d503201f nop
10048: 90000090 adrp x16, 20000 \<_GLOBAL_OFFSET_TABLE_\>
1004c: f9402211 ldr x17, \[x16,#64\]
10050: 91010210 add x16, x16, #0x40
10054: d61f0220 br x17

View File

@ -1,5 +1,6 @@
#source: emit-relocs-516.s #source: emit-relocs-516.s
#ld: -shared -T relocs.ld -e0 #ld: -shared -T relocs.ld -e0
#notarget: aarch64_be-*-*
#objdump: -dr #objdump: -dr
#... #...

View File

@ -0,0 +1,39 @@
#source: tls-large-desc.s
#ld: -shared -T relocs.ld -e0
#notarget: aarch64-*-*
#objdump: -dr
#...
Disassembly of section .text:
0000000000010000 \<test\>:
+10000: 58000101 ldr x1, 10020 \<test\+0x20\>
+10004: 100000e2 adr x2, 10020 \<test\+0x20\>
+10008: 8b020032 add x18, x1, x2
+1000c: d2a00000 movz x0, #0x0, lsl #16
+10010: f2800500 movk x0, #0x28
+10014: f8606a41 ldr x1, \[x18,x0\]
+10018: 8b000240 add x0, x18, x0
+1001c: d63f0020 blr x1
+10020: 00000000 .word 0x00000000
+10024: 0000ffe0 .word 0x0000ffe0
Disassembly of section .plt:
0000000000010028 <.plt>:
+10028: a9bf7bf0 stp x16, x30, \[sp,#-16\]!
+1002c: 90000090 adrp x16, 20000 \<_GLOBAL_OFFSET_TABLE_\>
+10030: f9401211 ldr x17, \[x16,#32\]
+10034: 91008210 add x16, x16, #0x20
+10038: d61f0220 br x17
+1003c: d503201f nop
+10040: d503201f nop
+10044: d503201f nop
+10048: a9bf0fe2 stp x2, x3, \[sp,#-16\]!
+1004c: 90000082 adrp x2, 20000 \<_GLOBAL_OFFSET_TABLE_\>
+10050: 90000083 adrp x3, 20000 \<_GLOBAL_OFFSET_TABLE_\>
+10054: f9400442 ldr x2, \[x2,#8\]
+10058: 91004063 add x3, x3, #0x10
+1005c: d61f0040 br x2
+10060: d503201f nop
+10064: d503201f nop

View File

@ -1,5 +1,6 @@
#source: tls-large-desc.s #source: tls-large-desc.s
#ld: -shared -T relocs.ld -e0 #ld: -shared -T relocs.ld -e0
#notarget: aarch64_be-*-*
#objdump: -dr #objdump: -dr
#... #...

View File

@ -0,0 +1,20 @@
#source: tls-large-ie.s
#ld: -shared -T relocs.ld -e0
#notarget: aarch64-*-*
#objdump: -dr
#...
Disassembly of section .text:
0000000000010000 \<test\>:
10000: 58000121 ldr x1, 10024 \<test\+0x24\>
10004: 10000102 adr x2, 10024 \<test\+0x24\>
10008: 8b020021 add x1, x1, x2
1000c: d53bd042 mrs x2, tpidr_el0
10010: d2a00000 movz x0, #0x0, lsl #16
10014: f2800100 movk x0, #0x8
10018: f8606820 ldr x0, \[x1,x0\]
1001c: 8b020000 add x0, x0, x2
10020: d503201f nop
10024: 0000(ffdc|0000) .word 0x0000(ffdc|0000)
10028: 0000(0000|ffdc) .word 0x0000(0000|ffdc)

View File

@ -1,5 +1,6 @@
#source: tls-large-ie.s #source: tls-large-ie.s
#ld: -shared -T relocs.ld -e0 #ld: -shared -T relocs.ld -e0
#notarget: aarch64_be-*-*
#objdump: -dr #objdump: -dr
#... #...

View File

@ -0,0 +1,19 @@
#source: tls-relax-large-desc-ie.s
#ld: -T relocs.ld -e0
#notarget: aarch64-*-*
#objdump: -dr
#...
Disassembly of section .text:
0000000000010000 <test>:
+10000: 58000101 ldr x1, 10020 \<test\+0x20\>
+10004: 100000e2 adr x2, 10020 \<test\+0x20\>
+10008: 8b020032 add x18, x1, x2
+1000c: d2a00000 movz x0, #0x0, lsl #16
+10010: f2800100 movk x0, #0x8
+10014: f8606a40 ldr x0, \[x18,x0\]
+10018: d503201f nop
+1001c: d503201f nop
+10020: 00000000 .word 0x00000000
+10024: 0000ffe0 .word 0x0000ffe0

View File

@ -1,5 +1,6 @@
#source: tls-relax-large-desc-ie.s #source: tls-relax-large-desc-ie.s
#ld: -T relocs.ld -e0 #ld: -T relocs.ld -e0
#notarget: aarch64_be-*-*
#objdump: -dr #objdump: -dr
#... #...

View File

@ -0,0 +1,19 @@
#source: tls-relax-large-desc-le.s
#ld: -T relocs.ld -e0
#notarget: aarch64-*-*
#objdump: -dr
#...
Disassembly of section .text:
0000000000010000 <test>:
+10000: 58000101 ldr x1, 10020 \<test\+0x20\>
+10004: 100000e2 adr x2, 10020 \<test\+0x20\>
+10008: 8b020032 add x18, x1, x2
+1000c: d2c00000 movz x0, #0x0, lsl #32
+10010: f2a00000 movk x0, #0x0, lsl #16
+10014: f2800200 movk x0, #0x10
+10018: d503201f nop
+1001c: d503201f nop
+10020: 00000000 .word 0x00000000
+10024: 0000ffe0 .word 0x0000ffe0

View File

@ -1,5 +1,6 @@
#source: tls-relax-large-desc-le.s #source: tls-relax-large-desc-le.s
#ld: -T relocs.ld -e0 #ld: -T relocs.ld -e0
#notarget: aarch64_be-*-*
#objdump: -dr #objdump: -dr
#... #...

View File

@ -0,0 +1,17 @@
#source: tls-relax-large-gd-ie.s
#ld: -T relocs.ld -e0
#notarget: aarch64-*-*
#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: 00000000 .word 0x00000000
+10028: 0000ffdc .word 0x0000ffdc

View File

@ -1,5 +1,6 @@
#source: tls-relax-large-gd-ie.s #source: tls-relax-large-gd-ie.s
#ld: -T relocs.ld -e0 #ld: -T relocs.ld -e0
#notarget: aarch64_be-*-*
#objdump: -dr #objdump: -dr
#... #...
0000000000010000 <test>: 0000000000010000 <test>:

View File

@ -0,0 +1,17 @@
#source: tls-relax-large-gd-le.s
#ld: -T relocs.ld -e0
#notarget: aarch64-*-*
#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: 00000000 .word 0x00000000
+10028: 0000ffdc .word 0x0000ffdc

View File

@ -1,5 +1,6 @@
#source: tls-relax-large-gd-le.s #source: tls-relax-large-gd-le.s
#ld: -T relocs.ld -e0 #ld: -T relocs.ld -e0
#notarget: aarch64_be-*-*
#objdump: -dr #objdump: -dr
#... #...
0000000000010000 <test>: 0000000000010000 <test>: