3 # RUN: yaml2obj --docnum=1 %s -o %t1.o
4 # RUN: not ld.lld %t1.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR %s
5 # ERR: error: {{.*}}: R_X86_64_GOTTPOFF must be used in MOVQ or ADDQ instructions only
6 # ERR: error: {{.*}}: R_X86_64_GOTTPOFF must be used in MOVQ or ADDQ instructions only
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.
16 OSABI: ELFOSABI_FREEBSD
22 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
24 Content: "FFFFFFFFFFFFFFFF"
27 Flags: [ SHF_ALLOC, SHF_TLS ]
36 Type: R_X86_64_GOTTPOFF
39 Type: R_X86_64_GOTTPOFF
49 # RUN: yaml2obj --docnum=2 %s -o %t2.o
50 # RUN: not ld.lld %t2.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR2 %s
51 # ERR2: error: {{.*}}: invalid prefix with R_X86_64_CODE_4_GOTTPOFF!
52 # ERR2: error: {{.*}}: invalid prefix with R_X86_64_CODE_6_GOTTPOFF!
54 ## YAML below contains 2 relocations of
55 ## R_X86_64_CODE_4_GOTTPOFF/R_X86_64_CODE_6_GOTTPOFF type, and a .text with
56 ## fake content filled by 0xFF. It's expected to get "invalid prefix" error
62 OSABI: ELFOSABI_FREEBSD
68 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
70 Content: "FFFFFFFFFFFFFFFFFFFF"
73 Flags: [ SHF_ALLOC, SHF_TLS ]
82 Type: R_X86_64_CODE_4_GOTTPOFF
85 Type: R_X86_64_CODE_6_GOTTPOFF
95 # RUN: yaml2obj --docnum=3 %s -o %t3.o
96 # RUN: not ld.lld %t3.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR3 %s
97 # ERR3: error: {{.*}}: R_X86_64_CODE_4_GOTTPOFF must be used in MOVQ or ADDQ instructions only
99 ## YAML below contains R_X86_64_CODE_4_GOTTPOFF relocation type, and a .text
100 ## with fake content filled by 0xd5, 0xFF, ... and 0xFF. It's expected to get
101 ## the error message as above.
106 OSABI: ELFOSABI_FREEBSD
112 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
114 Content: "d5FFFFFFFFFFFFFFFFFF"
117 Flags: [ SHF_ALLOC, SHF_TLS ]
126 Type: R_X86_64_CODE_4_GOTTPOFF
136 # RUN: yaml2obj --docnum=4 %s -o %t4.o
137 # RUN: not ld.lld %t4.o -o /dev/null 2>&1 | FileCheck --check-prefix=ERR4 %s
138 # ERR4: error: {{.*}}: R_X86_64_CODE_6_GOTTPOFF must be used in ADDQ instructions with NDD/NF/NDD+NF only
140 ## YAML below contains R_X86_64_CODE_6_GOTTPOFF relocation type, and a .text
141 ## with fake content filled by 0x62, 0xFF, ... and 0xFF. It's expected to get
142 ## the error message as above.
147 OSABI: ELFOSABI_FREEBSD
153 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
155 Content: "62FFFFFFFFFFFFFFFFFF"
158 Flags: [ SHF_ALLOC, SHF_TLS ]
167 Type: R_X86_64_CODE_6_GOTTPOFF