1
- # REQUIRES: aarch64
2
- # RUN: yaml2obj %s -o %t.o
1
+ # RUN: yaml2obj -DMACHINE=AARCH64 %s -o %t.o
3
2
# RUN: ld.lld --gc-sections %t.o -o %t
4
3
# RUN: llvm-readelf -S -r %t | FileCheck %s
5
4
6
- ## Test that we discard R_AARCH64_NONE , but respect the references it creates
5
+ ## Test that we discard R_*_NONE , but respect the references it creates
7
6
## among sections.
8
7
9
8
# CHECK: .data
12
11
# RUN: ld.lld -r %t.o -o %t
13
12
# RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
14
13
14
+ # RUN: yaml2obj -DBITS=32 -DMACHINE=ARM %s -o %t.o
15
+ # RUN: ld.lld -r %t.o -o %t
16
+ # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
17
+
18
+ # RUN: yaml2obj -DMACHINE=RISCV %s -o %t.o
19
+ # RUN: ld.lld -r %t.o -o %t
20
+ # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
21
+
22
+ # RUN: yaml2obj -DBITS=32 -DMACHINE=386 %s -o %t.o
23
+ # RUN: ld.lld -r %t.o -o %t
24
+ # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
25
+
26
+ # RUN: yaml2obj -DMACHINE=X86_64 %s -o %t.o
27
+ # RUN: ld.lld -r %t.o -o %t
28
+ # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
29
+
15
30
## Both REL and RELA are supported. .rel.llvm.call-graph-profile uses REL even
16
31
## if the prevailing format is RELA.
17
32
# RELOC: Section ({{.*}}) .rela.text {
18
- # RELOC-NEXT: 0x0 R_AARCH64_NONE .data 0x0
33
+ # RELOC-NEXT: 0x0 R_{{.*}}_NONE .data 0x0
19
34
# RELOC-NEXT: }
20
35
# RELOC: Section ({{.*}}) .rel.nonalloc1 {
21
- # RELOC-NEXT: 0x0 R_AARCH64_NONE .data
36
+ # RELOC-NEXT: 0x0 R_{{.*}}_NONE .data
22
37
# RELOC-NEXT: }
23
38
# RELOC: Section ({{.*}}) .rela.nonalloc2 {
24
- # RELOC-NEXT: 0x0 R_AARCH64_NONE .data 0x0
39
+ # RELOC-NEXT: 0x0 R_{{.*}}_NONE .data 0x0
25
40
# RELOC-NEXT: }
26
41
27
42
--- !ELF
28
43
FileHeader:
29
- Class: ELFCLASS64
44
+ Class: ELFCLASS[[BITS=64]]
30
45
Data: ELFDATA2LSB
31
46
Type: ET_REL
32
- Machine: EM_AARCH64
47
+ Machine: EM_[[MACHINE]]
33
48
Sections:
34
49
- Name: .text
35
50
Type: SHT_PROGBITS
@@ -46,19 +61,19 @@ Sections:
46
61
Info: .text
47
62
Relocations:
48
63
- Symbol: .data
49
- Type: R_AARCH64_NONE
64
+ Type: R_[[MACHINE]]_NONE
50
65
- Name: .rel.nonalloc1
51
66
Type: SHT_REL
52
67
Info: .nonalloc1
53
68
Relocations:
54
69
- Symbol: .data
55
- Type: R_AARCH64_NONE
70
+ Type: R_[[MACHINE]]_NONE
56
71
- Name: .rela.nonalloc2
57
72
Type: SHT_RELA
58
73
Info: .nonalloc2
59
74
Relocations:
60
75
- Symbol: .data
61
- Type: R_AARCH64_NONE
76
+ Type: R_[[MACHINE]]_NONE
62
77
Symbols:
63
78
- Name: .data
64
79
Type: STT_SECTION
0 commit comments