# Tests that lld can handle relocations of type R_X86_64_PC64 #RUN: yaml2obj -format=elf -docnum 1 %s -o %t1.o #RUN: lld -flavor gnu -target x86_64 %t1.o --noinhibit-exec -o %t2.out -static #RUN: llvm-objdump -s %t2.out | FileCheck %s #CHECK: Contents of section .data: #CHECK: 401000 0a00 --- FileHeader: Class: ELFCLASS64 Data: ELFDATA2LSB OSABI: ELFOSABI_GNU Type: ET_REL Machine: EM_X86_64 Sections: - Name: .text Type: SHT_PROGBITS Flags: [ SHF_ALLOC, SHF_EXECINSTR ] AddressAlign: 0x0000000000000004 Content: '' - Name: .data Type: SHT_PROGBITS Flags: [ SHF_WRITE, SHF_ALLOC ] AddressAlign: 0x0000000000000008 Content: '0000' - Name: .rela.data Type: SHT_RELA Link: .symtab AddressAlign: 0x0000000000000008 Info: .data Relocations: - Offset: 0x0000000000000000 Symbol: foo Type: R_X86_64_PC64 Addend: 8 - Name: .bss Type: SHT_NOBITS Flags: [ SHF_WRITE, SHF_ALLOC ] AddressAlign: 0x0000000000000004 Content: '' Symbols: Local: - Name: .text Type: STT_SECTION Section: .text - Name: .data Type: STT_SECTION Section: .data - Name: .bss Type: STT_SECTION Section: .bss Global: - Name: bar Type: STT_OBJECT Section: .data Size: 0x0000000000000008 - Name: foo Type: STT_OBJECT Section: .data Value: 0x0000000000000002 Size: 0x0000000000000002 ...