Skip to content

Commit fdbc2bd

Browse files
committed
[ELF][ARM] Add --no-show-raw-insn and -soname to some ARM tests
Delete some insignificant addresses to make it simpler for layout changes. llvm-svn: 370048
1 parent 73f0106 commit fdbc2bd

19 files changed

+60
-68
lines changed

lld/test/ELF/arm-branch-undef-weak-plt-thunk.s

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// REQUIRES: arm
2-
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %S/Inputs/arm-shared.s -o %t
3-
// RUN: ld.lld %t --shared -o %t.so
4-
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t2
5-
// RUN: ld.lld %t2 %t.so -o %t3
6-
// RUN: llvm-objdump -d -triple=armv7a-none-linux-gnueabi -start-address=69632 -stop-address=69664 %t3 | FileCheck %s
2+
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %S/Inputs/arm-shared.s -o %t1.o
3+
// RUN: ld.lld %t1.o --shared -soname=t1.so -o %t1.so
4+
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o
5+
// RUN: ld.lld %t.o %t1.so -o %t
6+
// RUN: llvm-objdump -d -triple=armv7a-none-linux-gnueabi -start-address=0x11000 -stop-address=0x11020 %t | FileCheck %s
77

88
// When we are dynamic linking, undefined weak references have a PLT entry so
99
// we must create a thunk for the branch to the PLT entry.

lld/test/ELF/arm-execute-only.s

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
// RUN: ld.lld %t.o -o %t.so -shared
55
// RUN: llvm-readelf -l %t.so | FileCheck --implicit-check-not=LOAD %s
66

7-
// RUN: ld.lld %t.o %t.o -o %t.so -shared
8-
// RUN: llvm-readelf -l %t.so | FileCheck --implicit-check-not=LOAD %s
9-
107
// RUN: echo ".section .foo,\"ax\"; \
118
// RUN: bx lr" > %t.s
129
// RUN: llvm-mc -filetype=obj -triple=armv7-pc-linux %t.s -o %t2.o

lld/test/ELF/arm-fpic-got.s

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: ld.lld %t.o -o %t
44
// RUN: llvm-readobj -S %t | FileCheck %s
55
// RUN: llvm-readobj -S --symbols %t | FileCheck -check-prefix=SYMBOLS %s
6-
// RUN: llvm-objdump -d -triple=armv7a-none-linux-gnueabi %t | FileCheck -check-prefix=CODE %s
6+
// RUN: llvm-objdump -d --no-show-raw-insn -triple=armv7a-none-linux-gnueabi %t | FileCheck -check-prefix=CODE %s
77

88
// Test the R_ARM_GOT_PREL relocation
99
.syntax unified
@@ -55,10 +55,10 @@ val:
5555
// CODE: Disassembly of section .text:
5656
// CODE-EMPTY:
5757
// CODE-NEXT: _start:
58-
// CODE-NEXT: 11000: 08 00 9f e5 ldr r0, [pc, #8]
59-
// CODE-NEXT: 11004: 00 00 9f e7 ldr r0, [pc, r0]
60-
// CODE-NEXT: 11008: 00 00 90 e5 ldr r0, [r0]
61-
// CODE-NEXT: 1100c: 1e ff 2f e1 bx lr
58+
// CODE-NEXT: 11000: ldr r0, [pc, #8]
59+
// CODE-NEXT: 11004: ldr r0, [pc, r0]
60+
// CODE-NEXT: 11008: ldr r0, [r0]
61+
// CODE-NEXT: 1100c: bx lr
6262
// CODE: $d.1:
6363
// 0x11004 + 0x0ff4 + 8 = 0x12000 = .got
64-
// CODE-NEXT: 11010: f4 0f 00 00
64+
// CODE-NEXT: 11010: f4 0f 00 00

lld/test/ELF/arm-gnu-ifunc-plt.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: arm
22
// RUN: llvm-mc -filetype=obj -triple=armv7a-linux-gnueabihf %S/Inputs/arm-shared.s -o %t1.o
3-
// RUN: ld.lld %t1.o --shared -o %t.so
3+
// RUN: ld.lld %t1.o --shared -soname=t.so -o %t.so
44
// RUN: llvm-mc -filetype=obj -triple=armv7a-linux-gnueabihf %s -o %t.o
55
// RUN: ld.lld --hash-style=sysv %t.so %t.o -o %tout
66
// RUN: llvm-objdump -triple=armv7a-linux-gnueabihf -d --no-show-raw-insn %tout | FileCheck %s --check-prefix=DISASM

lld/test/ELF/arm-pie-relative.s

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// REQUIRES: arm
2-
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t
3-
// RUN: ld.lld --hash-style=sysv %t --pie -o %t2
4-
// RUN: llvm-readobj -r %t2 | FileCheck %s
5-
// RUN: llvm-objdump -s %t2 | FileCheck %s --check-prefix=GOT
2+
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o
3+
// RUN: ld.lld --hash-style=sysv %t.o --pie -o %t
4+
// RUN: llvm-readobj -r %t | FileCheck %s
5+
// RUN: llvm-readelf -x .got %t | FileCheck %s --check-prefix=GOT
66

77
// Test that a R_ARM_GOT_BREL relocation with PIE results in a R_ARM_RELATIVE
88
// dynamic relocation
@@ -21,5 +21,5 @@ sym:
2121
// CHECK-NEXT: Section (4) .rel.dyn {
2222
// CHECK-NEXT: 0x2058 R_ARM_RELATIVE
2323

24-
// GOT: Contents of section .got:
24+
// GOT: section '.got':
2525
// GOT-NEXT: 2058 00300000

lld/test/ELF/arm-reloc-abs32.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ _start:
1313
// S + A = 0x124
1414
// CHECK: Disassembly of section .R_ARM_ABS32POS:
1515
// CHECK-EMPTY:
16-
// CHECK: 11000: 24 01 00 00
16+
// CHECK: 24 01 00 00
1717
.section .R_ARM_ABS32NEG, "ax",%progbits
1818
.word foo - 0x24
1919
// S = 0x100, A = -0x24
2020
// CHECK: Disassembly of section .R_ARM_ABS32NEG:
2121
// CHECK-EMPTY:
22-
// CHECK: 11004: dc 00 00 00
22+
// CHECK: dc 00 00 00

lld/test/ELF/arm-sbrel32.s

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ foo4: .space 4
3333
// CHECK: Disassembly of section .text:
3434
// CHECK-EMPTY:
3535
// CHECK-NEXT: _start:
36-
// CHECK-NEXT: 11000: 1e ff 2f e1 bx lr
37-
// CHECK: 11004: 00 00 00 00 .word 0x00000000
38-
// CHECK-NEXT: 11008: 04 00 00 00 .word 0x00000004
39-
// CHECK-NEXT: 1100c: 08 00 00 00 .word 0x00000008
40-
// CHECK-NEXT: 11010: 0c 00 00 00 .word 0x0000000c
36+
// CHECK-NEXT: 1e ff 2f e1 bx lr
37+
// CHECK: 00 00 00 00 .word 0x00000000
38+
// CHECK-NEXT: 04 00 00 00 .word 0x00000004
39+
// CHECK-NEXT: 08 00 00 00 .word 0x00000008
40+
// CHECK-NEXT: 0c 00 00 00 .word 0x0000000c

lld/test/ELF/arm-thumb-plt-reloc.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
// RUN: llvm-mc -filetype=obj -triple=thumbv7a-none-linux-gnueabi %s -o %t2
44
// RUN: ld.lld %t1 %t2 -o %t
55
// RUN: llvm-objdump -triple=thumbv7a-none-linux-gnueabi -d %t | FileCheck %s
6-
// RUN: ld.lld --hash-style=sysv -shared %t1 %t2 -o %t3
7-
// RUN: llvm-objdump -triple=thumbv7a-none-linux-gnueabi -d %t3 | FileCheck -check-prefix=DSO %s
8-
// RUN: llvm-readobj -S -r %t3 | FileCheck -check-prefix=DSOREL %s
6+
// RUN: ld.lld --hash-style=sysv -shared %t1 %t2 -o %t.so
7+
// RUN: llvm-objdump -triple=thumbv7a-none-linux-gnueabi -d %t.so | FileCheck -check-prefix=DSO %s
8+
// RUN: llvm-readobj -S -r %t.so | FileCheck -check-prefix=DSOREL %s
99
//
1010
// Test PLT entry generation
1111
.syntax unified
Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
// REQUIRES: arm
22
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=thumbv7a-none-linux-gnueabi %s -o %t
33
// RUN: ld.lld %t -o %t2
4-
// RUN: llvm-objdump -d %t2 -start-address=69632 -stop-address=69646 -triple=thumbv7a-linux-gnueabihf | FileCheck -check-prefix=CHECK1 %s
5-
// RUN: llvm-objdump -d %t2 -start-address=16846856 -stop-address=16846874 -triple=thumbv7a-linux-gnueabihf | FileCheck -check-prefix=CHECK2 %s
4+
// RUN: llvm-objdump -d %t2 -triple=thumbv7a | FileCheck %s
65
.syntax unified
76
.global _start, foo
87
.type _start, %function
@@ -16,16 +15,16 @@ _start:
1615
foo:
1716
bl _start
1817

19-
// CHECK1: Disassembly of section .text:
20-
// CHECK1-EMPTY:
21-
// CHECK1-NEXT: _start:
22-
// CHECK1-NEXT: 11000: ff f7 fe ff bl #-4
23-
// CHECK1: __Thumbv7ABSLongThunk__start:
24-
// CHECK1-NEXT: 11004: ff f7 fc bf b.w #-8 <_start>
18+
// CHECK: Disassembly of section .text:
19+
// CHECK-EMPTY:
20+
// CHECK-NEXT: _start:
21+
// CHECK-NEXT: 11000: ff f7 fe ff bl #-4
22+
// CHECK: __Thumbv7ABSLongThunk__start:
23+
// CHECK-NEXT: 11004: ff f7 fc bf b.w #-8 <_start>
2524

26-
// CHECK2: __Thumbv7ABSLongThunk__start:
27-
// CHECK2: 1011008: 41 f2 01 0c movw r12, #4097
28-
// CHECK2-NEXT: 101100c: c0 f2 01 0c movt r12, #1
29-
// CHECK2-NEXT: 1011010: 60 47 bx r12
30-
// CHECK2: foo:
31-
// CHECK2-NEXT: 1011012: ff f7 f9 ff bl #-14
25+
// CHECK: __Thumbv7ABSLongThunk__start:
26+
// CHECK: 1011008: 41 f2 01 0c movw r12, #4097
27+
// CHECK-NEXT: 101100c: c0 f2 01 0c movt r12, #1
28+
// CHECK-NEXT: 1011010: 60 47 bx r12
29+
// CHECK: foo:
30+
// CHECK-NEXT: 1011012: ff f7 f9 ff bl #-14

lld/test/ELF/arm-thumb-undefined-weak-narrow.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# CHECK: Disassembly of section .text:
77
# CHECK-EMPTY:
88
# CHECK-NEXT:_start:
9-
# CHECK-NEXT: 11000: ff e7 b #-2
9+
# CHECK-NEXT: ff e7 b #-2
1010

1111
# Test the R_ARM_THM_JUMP11 relocation (102) to an undefined weak reference
1212
# It should resolve to the next instruction, which is an offset of -2 which

lld/test/ELF/arm-thumb-undefined-weak.s

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ _start:
2929

3030
// CHECK: Disassembly of section .text:
3131
// CHECK-EMPTY:
32-
// 69636 = 0x11004
3332
// CHECK: 11000: {{.*}} beq.w #0 <_start+0x4>
3433
// CHECK-NEXT: 11004: {{.*}} b.w #0 <_start+0x8>
3534
// CHECK-NEXT: 11008: {{.*}} bl #0

lld/test/ELF/arm-tls-gd-nonpreemptible.s

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// RUN: ld.lld %t -o %t2
44
// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=armv7a-linux-gnueabi
55
// RUN: llvm-objdump -s %t2 | FileCheck %s
6-
// RUN: ld.lld --hash-style=sysv %t --shared -o %t3.so
6+
// RUN: ld.lld %t --shared -o %t3.so
77
// RUN: llvm-objdump -s %t3.so | FileCheck -check-prefix=CHECK-SHARED %s
88

99
// For an executable, we write the module index 1 and the offset into the TLS
@@ -68,5 +68,5 @@ x4:
6868
// CHECK-NEXT: 12018 01000000 08000000 01000000 0c000000
6969

7070
// CHECK-SHARED: Contents of section .got:
71-
// CHECK-SHARED-NEXT: 2050 00000000 00000000 00000000 04000000
72-
// CHECK-SHARED-NEXT: 2060 00000000 00000000 00000000 00000000
71+
// CHECK-SHARED-NEXT: 2058 00000000 00000000 00000000 04000000
72+
// CHECK-SHARED-NEXT: 2068 00000000 00000000 00000000 00000000

lld/test/ELF/arm-tls-ldm32.s

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// RUN: ld.lld --hash-style=sysv %t.o -o %t.so -shared
44
// RUN: llvm-readobj -S --dyn-relocations %t.so | FileCheck --check-prefix=SEC %s
55
// RUN: llvm-objdump -d -triple=armv7a-linux-gnueabi %t.so | FileCheck %s
6+
// RUN: ld.lld %t.o -o %t
7+
// RUN: llvm-objdump -d -triple=armv7a-linux-gnueabi %t | FileCheck --check-prefix=CHECK-EXE %s
68

79
// Test the handling of the local-dynamic TLS model. Dynamic loader finds
810
// module index R_ARM_TLS_DTPMOD32. The offset in the next GOT slot is 0
@@ -65,11 +67,8 @@ x:
6567
// CHECK-NEXT: 1008: 00 00 00 00
6668
// CHECK-NEXT: 100c: 04 00 00 00
6769

68-
// CHECK-EXE: Disassembly of section .text:
69-
// CHECK-EXE-EMPTY:
70-
// CHECK-NEXT-EXE: _start:
71-
// CHECK-NEXT-EXE: 11000: 00 f0 20 e3 nop
72-
73-
// CHECK-EXE: 11004: fc 0f 00 00
74-
// CHECK-EXE: 11008: 00 00 00 00
75-
// CHECK-EXE: 1100c: 04 00 00 00
70+
// CHECK-EXE: _start:
71+
// CHECK-EXE-NEXT: 11000: 00 f0 20 e3 nop
72+
// CHECK-EXE: 11004: fc 0f 00 00
73+
// CHECK-EXE-NEXT: 11008: 00 00 00 00
74+
// CHECK-EXE-NEXT: 1100c: 04 00 00 00

lld/test/ELF/arm-tls-norelax-gd-ie.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: arm
2-
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %p/Inputs/arm-tls-get-addr.s -o %t1
3-
// RUN: ld.lld %t1 --shared -o %t1.so
2+
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %p/Inputs/arm-tls-get-addr.s -o %t1.o
3+
// RUN: ld.lld %t1.o --shared -soname=t1.so -o %t1.so
44
// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=armv7a-linux-gnueabi
55
// RUN: ld.lld --hash-style=sysv %t1.so %t.o -o %t
66
// RUN: llvm-readobj -S --dyn-relocations %t | FileCheck %s

lld/test/ELF/arm-tls-norelax-gd-le.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: arm
2-
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %p/Inputs/arm-tls-get-addr.s -o %t1
3-
// RUN: ld.lld %t1 --shared -o %t1.so
2+
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %p/Inputs/arm-tls-get-addr.s -o %t1.o
3+
// RUN: ld.lld %t1.o --shared -soname=t1.so -o %t1.so
44
// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=armv7a-linux-gnueabi
55
// RUN: ld.lld --hash-style=sysv %t1.so %t.o -o %t
66
// RUN: llvm-objdump -s %t | FileCheck %s

lld/test/ELF/arm-tls-norelax-ie-le.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: arm
2-
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %p/Inputs/arm-tls-get-addr.s -o %t1
3-
// RUN: ld.lld %t1 --shared -o %t1.so
2+
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %p/Inputs/arm-tls-get-addr.s -o %t1.o
3+
// RUN: ld.lld %t1.o --shared -soname=t1.so -o %t1.so
44
// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=armv7a-linux-gnueabi
55
// RUN: ld.lld --hash-style=sysv %t1.so %t.o -o %t
66
// RUN: llvm-objdump -s -triple=armv7a-linux-gnueabi %t | FileCheck %s

lld/test/ELF/arm-tls-norelax-ld-le.s

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: arm
2-
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %p/Inputs/arm-tls-get-addr.s -o %t1
3-
// RUN: ld.lld %t1 --shared -o %t1.so
2+
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %p/Inputs/arm-tls-get-addr.s -o %t1.o
3+
// RUN: ld.lld %t1.o --shared -soname=t1.so -o %t1.so
44
// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=armv7a-linux-gnueabi
55
// RUN: ld.lld --hash-style=sysv %t1.so %t.o -o %t
66
// RUN: llvm-objdump -s %t | FileCheck %s

lld/test/ELF/arm-undefined-weak.s

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,10 @@ _start:
2929

3030
// CHECK: Disassembly of section .text:
3131
// CHECK-EMPTY:
32-
// 69636 = 0x11004
3332
// CHECK: 11000: {{.*}} b #-4 <_start+0x4>
3433
// CHECK-NEXT: 11004: {{.*}} bl #-4 <_start+0x8>
3534
// blx is transformed into bl so we don't change state
3635
// CHECK-NEXT: 11008: {{.*}} bl #-4 <_start+0xc>
3736
// CHECK-NEXT: 1100c: {{.*}} movt r0, #0
3837
// CHECK-NEXT: 11010: {{.*}} movw r0, #0
3938
// CHECK: 11014: {{.*}} .word 0x00000000
40-

lld/test/ELF/pack-dyn-relocs-arm2.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: arm
22

33
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %p/Inputs/arm-shared.s -o %t.so.o
4-
// RUN: ld.lld -shared %t.so.o -o %t.so
4+
// RUN: ld.lld -shared %t.so.o -soname=t.so -o %t.so
55

66
// RUN: llvm-mc -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t.o
77
// RUN: ld.lld -pie --pack-dyn-relocs=relr %t.o %t.so -o %t.exe

0 commit comments

Comments
 (0)