28 case ELF::R_X86_64_NONE:
29 case ELF::R_X86_64_64:
30 case ELF::R_X86_64_DTPOFF32:
31 case ELF::R_X86_64_DTPOFF64:
32 case ELF::R_X86_64_PC32:
33 case ELF::R_X86_64_PC64:
34 case ELF::R_X86_64_32:
35 case ELF::R_X86_64_32S:
44 case ELF::R_X86_64_NONE:
46 case ELF::R_X86_64_64:
47 case ELF::R_X86_64_DTPOFF32:
48 case ELF::R_X86_64_DTPOFF64:
50 case ELF::R_X86_64_PC32:
51 case ELF::R_X86_64_PC64:
53 case ELF::R_X86_64_32:
54 case ELF::R_X86_64_32S:
63 case ELF::R_AARCH64_ABS32:
64 case ELF::R_AARCH64_ABS64:
73 case ELF::R_AARCH64_ABS32:
75 case ELF::R_AARCH64_ABS64:
84 case ELF::R_BPF_64_32:
85 case ELF::R_BPF_64_64:
94 case ELF::R_BPF_64_32:
95 return (S + A) & 0xFFFFFFFF;
96 case ELF::R_BPF_64_64:
107 case ELF::R_MIPS_TLS_DTPREL64:
108 case ELF::R_MIPS_PC32:
121 case ELF::R_MIPS_TLS_DTPREL64:
123 case ELF::R_MIPS_PC32:
132 case ELF::R_PPC64_ADDR32:
133 case ELF::R_PPC64_ADDR64:
142 case ELF::R_PPC64_ADDR32:
144 case ELF::R_PPC64_ADDR64:
174 case ELF::R_SPARC_32:
175 case ELF::R_SPARC_64:
176 case ELF::R_SPARC_UA32:
177 case ELF::R_SPARC_UA64:
186 case ELF::R_SPARC_32:
187 case ELF::R_SPARC_64:
188 case ELF::R_SPARC_UA32:
189 case ELF::R_SPARC_UA64:
198 case ELF::R_AMDGPU_ABS32:
199 case ELF::R_AMDGPU_ABS64:
208 case ELF::R_AMDGPU_ABS32:
209 case ELF::R_AMDGPU_ABS64:
218 case ELF::R_386_NONE:
220 case ELF::R_386_PC32:
229 case ELF::R_386_NONE:
233 case ELF::R_386_PC32:
241 return Type == ELF::R_PPC_ADDR32;
245 if (R.
getType() == ELF::R_PPC_ADDR32)
251 return Type == ELF::R_ARM_ABS32;
255 if (R.
getType() == ELF::R_ARM_ABS32)
256 return (S + A) & 0xFFFFFFFF;
282 return Type == ELF::R_LANAI_32;
286 if (R.
getType() == ELF::R_LANAI_32)
294 case ELF::R_MIPS_TLS_DTPREL32:
304 if (Rel == ELF::R_MIPS_32)
305 return (S + A) & 0xFFFFFFFF;
306 if (Rel == ELF::R_MIPS_TLS_DTPREL32)
307 return (S + A) & 0xFFFFFFFF;
313 case ELF::R_SPARC_32:
314 case ELF::R_SPARC_UA32:
323 if (Rel == ELF::R_SPARC_32 || Rel == ELF::R_SPARC_UA32)
329 return Type == ELF::R_HEX_32;
333 if (R.
getType() == ELF::R_HEX_32)
340 case ELF::R_RISCV_NONE:
341 case ELF::R_RISCV_32:
342 case ELF::R_RISCV_32_PCREL:
343 case ELF::R_RISCV_64:
344 case ELF::R_RISCV_SET6:
345 case ELF::R_RISCV_SUB6:
346 case ELF::R_RISCV_ADD8:
347 case ELF::R_RISCV_SUB8:
348 case ELF::R_RISCV_ADD16:
349 case ELF::R_RISCV_SUB16:
350 case ELF::R_RISCV_ADD32:
351 case ELF::R_RISCV_SUB32:
352 case ELF::R_RISCV_ADD64:
353 case ELF::R_RISCV_SUB64:
363 case ELF::R_RISCV_NONE:
365 case ELF::R_RISCV_32:
366 return (S + RA) & 0xFFFFFFFF;
367 case ELF::R_RISCV_32_PCREL:
368 return (S + RA - R.
getOffset()) & 0xFFFFFFFF;
369 case ELF::R_RISCV_64:
371 case ELF::R_RISCV_SET6:
372 return (A & 0xC0) | ((S +
RA) & 0x3F);
373 case ELF::R_RISCV_SUB6:
374 return (A & 0xC0) | (((A & 0x3F) - (S + RA)) & 0x3F);
375 case ELF::R_RISCV_ADD8:
376 return (A + (S + RA)) & 0xFF;
377 case ELF::R_RISCV_SUB8:
378 return (A - (S + RA)) & 0xFF;
379 case ELF::R_RISCV_ADD16:
380 return (A + (S + RA)) & 0xFFFF;
381 case ELF::R_RISCV_SUB16:
382 return (A - (S + RA)) & 0xFFFF;
383 case ELF::R_RISCV_ADD32:
384 return (A + (S + RA)) & 0xFFFFFFFF;
385 case ELF::R_RISCV_SUB32:
386 return (A - (S + RA)) & 0xFFFFFFFF;
387 case ELF::R_RISCV_ADD64:
388 return (A + (S + RA));
389 case ELF::R_RISCV_SUB64:
390 return (A - (S + RA));
410 return (S + A) & 0xFFFFFFFF;
429 return (S + A) & 0xFFFFFFFF;
451 return (S + A) & 0xFFFFFFFF;
470 return (S + A) & 0xFFFFFFFF;
490 case wasm::R_WASM_FUNCTION_INDEX_LEB:
491 case wasm::R_WASM_TABLE_INDEX_SLEB:
492 case wasm::R_WASM_TABLE_INDEX_I32:
493 case wasm::R_WASM_MEMORY_ADDR_LEB:
494 case wasm::R_WASM_MEMORY_ADDR_SLEB:
495 case wasm::R_WASM_MEMORY_ADDR_I32:
496 case wasm::R_WASM_TYPE_INDEX_LEB:
497 case wasm::R_WASM_GLOBAL_INDEX_LEB:
498 case wasm::R_WASM_FUNCTION_OFFSET_I32:
499 case wasm::R_WASM_SECTION_OFFSET_I32:
500 case wasm::R_WASM_EVENT_INDEX_LEB:
509 case wasm::R_WASM_FUNCTION_INDEX_LEB:
510 case wasm::R_WASM_TABLE_INDEX_SLEB:
511 case wasm::R_WASM_TABLE_INDEX_I32:
512 case wasm::R_WASM_MEMORY_ADDR_LEB:
513 case wasm::R_WASM_MEMORY_ADDR_SLEB:
514 case wasm::R_WASM_MEMORY_ADDR_I32:
515 case wasm::R_WASM_TYPE_INDEX_LEB:
516 case wasm::R_WASM_GLOBAL_INDEX_LEB:
517 case wasm::R_WASM_FUNCTION_OFFSET_I32:
518 case wasm::R_WASM_SECTION_OFFSET_I32:
519 case wasm::R_WASM_EVENT_INDEX_LEB:
527 std::pair<bool (*)(uint64_t), RelocationResolver>
541 return {
nullptr,
nullptr};
543 }
else if (Obj.
isELF()) {
569 return {
nullptr,
nullptr};
575 "Invalid word size in object file");
599 return {
nullptr,
nullptr};
604 return {
nullptr,
nullptr};
605 }
else if (Obj.
isWasm()) {
608 return {
nullptr,
nullptr};
static bool supportsSystemZ(uint64_t Type)
static uint64_t resolveLanai(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsMips32(uint64_t Type)
static uint64_t resolveMips64(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsLanai(uint64_t Type)
static uint64_t resolvePPC32(RelocationRef R, uint64_t S, uint64_t A)
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This class represents lattice values for constants.
static bool supportsBPF(uint64_t Type)
static bool supportsSparc32(uint64_t Type)
uint64_t getOffset() const
std::pair< bool(*)(uint64_t), RelocationResolver > getRelocationResolver(const ObjectFile &Obj)
static bool supportsPPC32(uint64_t Type)
static uint64_t resolveCOFFARM64(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsPPC64(uint64_t Type)
This class is the base class for all object file types.
static bool supportsWasm32(uint64_t Type)
Error takeError()
Take ownership of the stored error.
Base class for error info classes.
SI optimize exec mask operations pre RA
static uint64_t resolveSparc64(RelocationRef R, uint64_t S, uint64_t A)
This is a value type class that represents a single relocation in the list of relocations in the obje...
Tagged union holding either a T or a Error.
static uint64_t resolveHexagon(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsARM(uint64_t Type)
static bool supportsX86(uint64_t Type)
static bool supportsMips64(uint64_t Type)
static uint64_t resolveSparc32(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsAVR(uint64_t Type)
virtual uint8_t getBytesInAddress() const =0
The number of bytes used to represent an address in this object file format.
The instances of the Type class are immutable: once they are created, they are never changed...
static uint64_t resolveCOFFX86(RelocationRef R, uint64_t S, uint64_t A)
static uint64_t resolveCOFFARM(RelocationRef R, uint64_t S, uint64_t A)
Expected< int64_t > getAddend() const
static uint64_t resolveX86_64(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsX86_64(uint64_t Type)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static uint64_t resolveAVR(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsSparc64(uint64_t Type)
void handleAllErrors(Error E, HandlerTs &&... Handlers)
Behaves the same as handleErrors, except that by contract all errors must be handled by the given han...
static uint64_t resolveRISCV(RelocationRef R, uint64_t S, uint64_t A)
static uint64_t resolveARM(RelocationRef R, uint64_t S, uint64_t A)
virtual Triple::ArchType getArch() const =0
static uint64_t resolveAArch64(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsCOFFARM64(uint64_t Type)
static uint64_t resolveMips32(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsAmdgpu(uint64_t Type)
static uint64_t resolveBPF(RelocationRef R, uint64_t S, uint64_t A)
static uint64_t resolveAmdgpu(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsHexagon(uint64_t Type)
static bool supportsMachOX86_64(uint64_t Type)
static uint64_t resolveX86(RelocationRef R, uint64_t S, uint64_t A)
static uint64_t resolvePPC64(RelocationRef R, uint64_t S, uint64_t A)
static uint64_t resolveSystemZ(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsCOFFX86_64(uint64_t Type)
static bool supportsCOFFX86(uint64_t Type)
static bool supportsCOFFARM(uint64_t Type)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static bool supportsRISCV(uint64_t Type)
static uint64_t resolveCOFFX86_64(RelocationRef R, uint64_t S, uint64_t A)
static uint64_t resolveMachOX86_64(RelocationRef R, uint64_t S, uint64_t A)
static int64_t getELFAddend(RelocationRef R)
static uint64_t resolveWasm32(RelocationRef R, uint64_t S, uint64_t A)
static bool supportsAArch64(uint64_t Type)