Skip to content

Commit 3fd3095

Browse files
committed
[ELF][test] Test getImplicitAddend for R_ARM_NONE/R_RISCV_NONE/R_386_NONE/R_X86_64_NONE
Similar to f457863
1 parent 5966c2e commit 3fd3095

File tree

4 files changed

+26
-89
lines changed

4 files changed

+26
-89
lines changed

lld/test/ELF/relocation-none-arm.s

Lines changed: 0 additions & 26 deletions
This file was deleted.

lld/test/ELF/relocation-none-i386.s

Lines changed: 0 additions & 26 deletions
This file was deleted.

lld/test/ELF/relocation-none-x86-64.s

Lines changed: 0 additions & 26 deletions
This file was deleted.

lld/test/ELF/relocation-none-aarch64.test renamed to lld/test/ELF/relocation-none.test

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# REQUIRES: aarch64
2-
# RUN: yaml2obj %s -o %t.o
1+
# RUN: yaml2obj -DMACHINE=AARCH64 %s -o %t.o
32
# RUN: ld.lld --gc-sections %t.o -o %t
43
# RUN: llvm-readelf -S -r %t | FileCheck %s
54

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
76
## among sections.
87

98
# CHECK: .data
@@ -12,24 +11,40 @@
1211
# RUN: ld.lld -r %t.o -o %t
1312
# RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
1413

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+
1530
## Both REL and RELA are supported. .rel.llvm.call-graph-profile uses REL even
1631
## if the prevailing format is RELA.
1732
# RELOC: Section ({{.*}}) .rela.text {
18-
# RELOC-NEXT: 0x0 R_AARCH64_NONE .data 0x0
33+
# RELOC-NEXT: 0x0 R_{{.*}}_NONE .data 0x0
1934
# RELOC-NEXT: }
2035
# RELOC: Section ({{.*}}) .rel.nonalloc1 {
21-
# RELOC-NEXT: 0x0 R_AARCH64_NONE .data
36+
# RELOC-NEXT: 0x0 R_{{.*}}_NONE .data
2237
# RELOC-NEXT: }
2338
# RELOC: Section ({{.*}}) .rela.nonalloc2 {
24-
# RELOC-NEXT: 0x0 R_AARCH64_NONE .data 0x0
39+
# RELOC-NEXT: 0x0 R_{{.*}}_NONE .data 0x0
2540
# RELOC-NEXT: }
2641

2742
--- !ELF
2843
FileHeader:
29-
Class: ELFCLASS64
44+
Class: ELFCLASS[[BITS=64]]
3045
Data: ELFDATA2LSB
3146
Type: ET_REL
32-
Machine: EM_AARCH64
47+
Machine: EM_[[MACHINE]]
3348
Sections:
3449
- Name: .text
3550
Type: SHT_PROGBITS
@@ -46,19 +61,19 @@ Sections:
4661
Info: .text
4762
Relocations:
4863
- Symbol: .data
49-
Type: R_AARCH64_NONE
64+
Type: R_[[MACHINE]]_NONE
5065
- Name: .rel.nonalloc1
5166
Type: SHT_REL
5267
Info: .nonalloc1
5368
Relocations:
5469
- Symbol: .data
55-
Type: R_AARCH64_NONE
70+
Type: R_[[MACHINE]]_NONE
5671
- Name: .rela.nonalloc2
5772
Type: SHT_RELA
5873
Info: .nonalloc2
5974
Relocations:
6075
- Symbol: .data
61-
Type: R_AARCH64_NONE
76+
Type: R_[[MACHINE]]_NONE
6277
Symbols:
6378
- Name: .data
6479
Type: STT_SECTION

0 commit comments

Comments
 (0)