1# REQUIRES: x86 2 3# RUN: yaml2obj %s -o %t.o 4# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s 5# ERR: R_X86_64_GOTTPOFF must be used in MOVQ or ADDQ instructions only 6# ERR: R_X86_64_GOTTPOFF must be used in MOVQ or ADDQ instructions only 7 8## YAML below contains 2 relocations of type R_X86_64_GOTTPOFF, and a .text 9## with fake content filled by 0xFF. That means instructions for relaxation are 10## "broken", so they does not match any known valid relaxations. We also generate 11## .tls section because we need it for correct processing of STT_TLS symbol. 12!ELF 13FileHeader: 14 Class: ELFCLASS64 15 Data: ELFDATA2LSB 16 OSABI: ELFOSABI_FREEBSD 17 Type: ET_REL 18 Machine: EM_X86_64 19Sections: 20 - Type: SHT_PROGBITS 21 Name: .text 22 Flags: [ SHF_ALLOC, SHF_EXECINSTR ] 23 AddressAlign: 0x04 24 Content: "FFFFFFFFFFFFFFFF" 25 - Type: SHT_PROGBITS 26 Name: .tls 27 Flags: [ SHF_ALLOC, SHF_TLS ] 28 - Type: SHT_REL 29 Name: .rel.text 30 Link: .symtab 31 Info: .text 32 AddressAlign: 0x04 33 Relocations: 34 - Offset: 4 35 Symbol: foo 36 Type: R_X86_64_GOTTPOFF 37 - Offset: 4 38 Symbol: foo 39 Type: R_X86_64_GOTTPOFF 40Symbols: 41 - Name: foo 42 Type: STT_TLS 43 Section: .text 44 Value: 0x12345 45 Size: 4 46 Binding: STB_GLOBAL 47 48