1# REQUIRES: x86
2
3# RUN: llvm-mc -filetype=obj -triple=x86_64-linux-musl %s -o %t.o
4# RUN: ld.lld --gc-sections %t.o -o %t
5# RUN: llvm-readelf -S -r %t | FileCheck %s
6
7# Test that we discard R_X86_64_NONE, but respect the
8# references it creates among sections.
9
10# CHECK: .data
11# CHECK: There are no relocations in this file.
12
13# RUN: ld.lld -r %t.o -o %t
14# RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
15
16# RELOC:      Section ({{.*}}) .rela.text {
17# RELOC-NEXT:   0x0 R_X86_64_NONE .data 0x0
18# RELOC-NEXT: }
19
20.globl _start
21_start:
22  ret
23  .reloc 0, R_X86_64_NONE, .data
24
25.data
26  .long 0
27