21 AMDGPUELFObjectWriter(
bool Is64Bit, uint8_t OSABI,
bool HasRelocationAddend,
32AMDGPUELFObjectWriter::AMDGPUELFObjectWriter(
bool Is64Bit,
34 bool HasRelocationAddend,
37 HasRelocationAddend, ABIVersion) {}
39unsigned AMDGPUELFObjectWriter::getRelocType(
MCContext &Ctx,
43 if (
const auto *SymA =
Target.getSymA()) {
46 if (SymA->getSymbol().getName() ==
"SCRATCH_RSRC_DWORD0" ||
47 SymA->getSymbol().getName() ==
"SCRATCH_RSRC_DWORD1")
48 return ELF::R_AMDGPU_ABS32_LO;
51 switch (
Target.getAccessVariant()) {
55 return ELF::R_AMDGPU_GOTPCREL;
57 return ELF::R_AMDGPU_GOTPCREL32_LO;
59 return ELF::R_AMDGPU_GOTPCREL32_HI;
61 return ELF::R_AMDGPU_REL32_LO;
63 return ELF::R_AMDGPU_REL32_HI;
65 return ELF::R_AMDGPU_REL64;
67 return ELF::R_AMDGPU_ABS32_LO;
69 return ELF::R_AMDGPU_ABS32_HI;
78 return ELF::R_AMDGPU_REL32;
81 return IsPCRel ? ELF::R_AMDGPU_REL32 : ELF::R_AMDGPU_ABS32;
83 return IsPCRel ? ELF::R_AMDGPU_REL64 : ELF::R_AMDGPU_ABS64;
87 const auto *SymA =
Target.getSymA();
90 if (SymA->getSymbol().isUndefined()) {
92 SymA->getSymbol().getName() +
"'");
93 return ELF::R_AMDGPU_NONE;
95 return ELF::R_AMDGPU_REL16;
101std::unique_ptr<MCObjectTargetWriter>
103 bool HasRelocationAddend,
104 uint8_t ABIVersion) {
105 return std::make_unique<AMDGPUELFObjectWriter>(Is64Bit, OSABI,
Provides AMDGPU specific target descriptions.
PowerPC TLS Dynamic Call Fixup
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Context object for machine code objects.
void reportError(SMLoc L, const Twine &Msg)
virtual unsigned getRelocType(MCContext &Ctx, const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const =0
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
@ VK_AMDGPU_GOTPCREL32_LO
@ VK_AMDGPU_GOTPCREL32_HI
This represents an "assembler immediate".
Target - Wrapper for Target specific information.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ fixup_si_sopp_br
16-bit PC relative fixup for SOPP branch instructions.
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< MCObjectTargetWriter > createAMDGPUELFObjectWriter(bool Is64Bit, uint8_t OSABI, bool HasRelocationAddend, uint8_t ABIVersion)
MCFixupKind
Extensible enumeration to represent the type of a fixup.
@ FK_PCRel_4
A four-byte pc relative fixup.
@ FirstLiteralRelocationKind
The range [FirstLiteralRelocationKind, MaxTargetFixupKind) is used for relocations coming from ....
@ FK_Data_8
A eight-byte fixup.
@ FK_Data_4
A four-byte fixup.
@ FK_SecRel_4
A four-byte section relative fixup.