Skip to content

Commit c861972

Browse files
committed
Update test according to review feedback
1 parent 1e1b68f commit c861972

File tree

1 file changed

+22
-49
lines changed

1 file changed

+22
-49
lines changed

lld/test/ELF/aarch64-execute-only-plt.s

Lines changed: 22 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,33 @@
22
// RUN: rm -rf %t && split-file %s %t && cd %t
33

44
// RUN: llvm-mc -filetype=obj -triple=aarch64 start.s -o start.o
5-
// RUN: llvm-mc -filetype=obj -triple=aarch64 foo-xo-same-section.s -o foo-xo-same-section.o
6-
// RUN: llvm-mc -filetype=obj -triple=aarch64 foo-rx-same-section.s -o foo-rx-same-section.o
7-
// RUN: llvm-mc -filetype=obj -triple=aarch64 foo-xo-different-section.s -o foo-xo-different-section.o
8-
// RUN: llvm-mc -filetype=obj -triple=aarch64 foo-rx-different-section.s -o foo-rx-different-section.o
5+
// RUN: llvm-mc -filetype=obj -triple=aarch64 xo-same-section.s -o xo-same-section.o
6+
// RUN: llvm-mc -filetype=obj -triple=aarch64 rx-same-section.s -o rx-same-section.o
7+
// RUN: llvm-mc -filetype=obj -triple=aarch64 xo-different-section.s -o xo-different-section.o
8+
// RUN: llvm-mc -filetype=obj -triple=aarch64 rx-different-section.s -o rx-different-section.o
99
// RUN: llvm-mc -filetype=obj -triple=aarch64 %p/Inputs/plt-aarch64.s -o plt.o
1010
// RUN: ld.lld -shared plt.o -soname=t2.so -o plt.so
11-
// RUN: ld.lld start.o foo-xo-same-section.o plt.so -o xo-same-section
12-
// RUN: ld.lld start.o foo-rx-same-section.o plt.so -o rx-same-section
13-
// RUN: ld.lld start.o foo-xo-different-section.o plt.so -o xo-different-section
14-
// RUN: ld.lld start.o foo-rx-different-section.o plt.so -o rx-different-section
15-
// RUN: llvm-readobj -S -l xo-same-section | FileCheck --check-prefix=CHECK-XO %s
16-
// RUN: llvm-readobj -S -l rx-same-section | FileCheck --check-prefix=CHECK-RX %s
17-
// RUN: llvm-readobj -S -l xo-different-section | FileCheck --check-prefix=CHECK-XO %s
18-
// RUN: llvm-readobj -S -l rx-different-section | FileCheck --check-prefix=CHECK-RX %s
11+
// RUN: ld.lld start.o xo-same-section.o plt.so -o xo-same-section
12+
// RUN: ld.lld start.o rx-same-section.o plt.so -o rx-same-section
13+
// RUN: ld.lld start.o xo-different-section.o plt.so -o xo-different-section
14+
// RUN: ld.lld start.o rx-different-section.o plt.so -o rx-different-section
15+
// RUN: llvm-readelf -S -l xo-same-section | FileCheck --check-prefix=CHECK-XO %s
16+
// RUN: llvm-readelf -S -l rx-same-section | FileCheck --check-prefix=CHECK-RX %s
17+
// RUN: llvm-readelf -S -l xo-different-section | FileCheck --check-prefix=CHECK-XO %s
18+
// RUN: llvm-readelf -S -l rx-different-section | FileCheck --check-prefix=CHECK-RX %s
1919
// RUN: llvm-objdump -d --no-show-raw-insn xo-same-section | FileCheck --check-prefix=DISASM %s
2020
// RUN: llvm-objdump -d --no-show-raw-insn rx-same-section | FileCheck --check-prefix=DISASM %s
2121
// RUN: llvm-objdump -d --no-show-raw-insn xo-different-section | FileCheck --check-prefix=DISASM %s
2222
// RUN: llvm-objdump -d --no-show-raw-insn rx-different-section | FileCheck --check-prefix=DISASM %s
2323

24-
// CHECK-XO: Name: .plt
25-
// CHECK-XO-NEXT: Type: SHT_PROGBITS
26-
// CHECK-XO-NEXT: Flags [
27-
// CHECK-XO-NEXT: SHF_AARCH64_PURECODE
28-
// CHECK-XO-NEXT: SHF_ALLOC
29-
// CHECK-XO-NEXT: SHF_EXECINSTR
30-
// CHECK-XO-NEXT: ]
31-
// CHECK-XO-NEXT: Address: 0x2102E0
24+
/// Name Type Address Off Size ES Flg Lk Inf Al
25+
// CHECK-XO: .plt PROGBITS 00000000002102e0 0002e0 000040 00 AXy 0 0 16
26+
// CHECK-RX: .plt PROGBITS 00000000002102e0 0002e0 000040 00 AX 0 0 16
3227

3328
/// The address of .plt above should be within this program header.
34-
// CHECK-XO: VirtualAddress: 0x2102C8
35-
// CHECK-XO-NEXT: PhysicalAddress: 0x2102C8
36-
// CHECK-XO-NEXT: FileSize: 88
37-
// CHECK-XO-NEXT: MemSize: 88
38-
// CHECK-XO-NEXT: Flags [
39-
// CHECK-XO-NEXT: PF_X
40-
// CHECK-XO-NEXT: ]
41-
42-
// CHECK-RX: Name: .plt
43-
// CHECK-RX-NEXT: Type: SHT_PROGBITS
44-
// CHECK-RX-NEXT: Flags [
45-
// CHECK-RX-NEXT: SHF_ALLOC
46-
// CHECK-RX-NEXT: SHF_EXECINSTR
47-
// CHECK-RX-NEXT: ]
48-
// CHECK-RX-NEXT: Address: 0x2102E0
49-
50-
/// The address of .plt above should be within this program header.
51-
// CHECK-RX: VirtualAddress: 0x2102C8
52-
// CHECK-RX-NEXT: PhysicalAddress: 0x2102C8
53-
// CHECK-RX-NEXT: FileSize: 88
54-
// CHECK-RX-NEXT: MemSize: 88
55-
// CHECK-RX-NEXT: Flags [
56-
// CHECK-RX-NEXT: PF_R
57-
// CHECK-RX-NEXT: PF_X
58-
// CHECK-RX-NEXT: ]
29+
/// Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
30+
// CHECK-XO: LOAD 0x0002c8 0x00000000002102c8 0x00000000002102c8 0x000058 0x000058 E 0x10000
31+
// CHECK-RX: LOAD 0x0002c8 0x00000000002102c8 0x00000000002102c8 0x000058 0x000058 R E 0x10000
5932

6033
// DISASM-LABEL: Disassembly of section .plt:
6134
// DISASM-LABEL: <.plt>:
@@ -90,25 +63,25 @@ _start:
9063
bl weak
9164
ret
9265

93-
//--- foo-xo-same-section.s
66+
//--- xo-same-section.s
9467
.section .text,"axy",@progbits,unique,0
9568
.global foo
9669
foo:
9770
ret
9871

99-
//--- foo-rx-same-section.s
72+
//--- rx-same-section.s
10073
.section .text,"ax",@progbits,unique,0
10174
.global foo
10275
foo:
10376
ret
10477

105-
//--- foo-xo-different-section.s
78+
//--- xo-different-section.s
10679
.section .foo,"axy",@progbits,unique,0
10780
.global foo
10881
foo:
10982
ret
11083

111-
//--- foo-rx-different-section.s
84+
//--- rx-different-section.s
11285
.section .foo,"ax",@progbits,unique,0
11386
.global foo
11487
foo:

0 commit comments

Comments
 (0)