1 # RUN: yaml2obj -DMACHINE=AARCH64 %s -o %t.o
2 # RUN: ld.lld --gc-sections %t.o -o %t
3 # RUN: llvm-readelf -S -r %t | FileCheck %s
5 ## Test that we discard R_*_NONE, but respect the references it creates
9 # CHECK: There are no relocations in this file.
11 # RUN: ld.lld -r %t.o -o %t
12 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
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
18 # RUN: yaml2obj -DBITS=32 -DMACHINE=PPC %s -o %t.o
19 # RUN: ld.lld -r %t.o -o %t
20 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
22 # RUN: yaml2obj -DMACHINE=PPC64 %s -o %t.o
23 # RUN: ld.lld -r %t.o -o %t
24 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
26 # RUN: yaml2obj -DMACHINE=RISCV %s -o %t.o
27 # RUN: ld.lld -r %t.o -o %t
28 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
30 # RUN: yaml2obj -DBITS=32 -DMACHINE=386 %s -o %t.o
31 # RUN: ld.lld -r %t.o -o %t
32 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
34 # RUN: yaml2obj -DMACHINE=X86_64 %s -o %t.o
35 # RUN: ld.lld -r %t.o -o %t
36 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
38 ## Both REL and RELA are supported. .rel.llvm.call-graph-profile uses REL even
39 ## if the prevailing format is RELA.
40 # RELOC: Section ({{.*}}) .rela.text {
41 # RELOC-NEXT: 0x0 R_{{.*}}_NONE .data 0x0
43 # RELOC: Section ({{.*}}) .rel.nonalloc1 {
44 # RELOC-NEXT: 0x0 R_{{.*}}_NONE .data
46 # RELOC: Section ({{.*}}) .rela.nonalloc2 {
47 # RELOC-NEXT: 0x0 R_{{.*}}_NONE .data 0x0
52 Class: ELFCLASS[[BITS=64]]
55 Machine: EM_[[MACHINE]]
59 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
62 Flags: [ SHF_WRITE, SHF_ALLOC ]
72 Type: R_[[MACHINE]]_NONE
73 - Name: .rel.nonalloc1
78 Type: R_[[MACHINE]]_NONE
79 - Name: .rela.nonalloc2
84 Type: R_[[MACHINE]]_NONE