22 static constexpr uint8_t SignBitMask = 0x80;
25 PPCXCOFFObjectWriter(
bool Is64Bit);
27 std::pair<uint8_t, uint8_t>
29 bool IsPCRel)
const override;
33PPCXCOFFObjectWriter::PPCXCOFFObjectWriter(
bool Is64Bit)
36std::unique_ptr<MCObjectTargetWriter>
38 return std::make_unique<PPCXCOFFObjectWriter>(Is64Bit);
41std::pair<uint8_t, uint8_t> PPCXCOFFObjectWriter::getRelocTypeAndSignSize(
45 :
Target.getSymA()->getKind();
52 const uint8_t EncodedSignednessIndicator = IsPCRel ? SignBitMask : 0u;
58 switch ((
unsigned)
Fixup.getKind()) {
62 const uint8_t SignAndSizeForHalf16 = EncodedSignednessIndicator | 15;
67 return {XCOFF::RelocationType::R_TOC, SignAndSizeForHalf16};
69 return {XCOFF::RelocationType::R_TOCU, SignAndSizeForHalf16};
71 return {XCOFF::RelocationType::R_TOCL, SignAndSizeForHalf16};
73 return {XCOFF::RelocationType::R_TLS_LE, SignAndSizeForHalf16};
75 return {XCOFF::RelocationType::R_TLS_LD, SignAndSizeForHalf16};
86 return {XCOFF::RelocationType::R_TOC, 15};
88 return {XCOFF::RelocationType::R_TOCL, 15};
90 return {XCOFF::RelocationType::R_TLS_LE, 15};
92 return {XCOFF::RelocationType::R_TLS_LD, 15};
98 return {XCOFF::RelocationType::R_RBR, EncodedSignednessIndicator | 25};
100 return {XCOFF::RelocationType::R_RBA, EncodedSignednessIndicator | 25};
103 return {XCOFF::RelocationType::R_REF, 0};
109 const uint8_t SignAndSizeForFKData =
110 EncodedSignednessIndicator |
116 return {XCOFF::RelocationType::R_TLS, SignAndSizeForFKData};
118 return {XCOFF::RelocationType::R_TLSM, SignAndSizeForFKData};
120 return {XCOFF::RelocationType::R_TLS_IE, SignAndSizeForFKData};
122 return {XCOFF::RelocationType::R_TLS_LE, SignAndSizeForFKData};
124 return {XCOFF::RelocationType::R_TLS_LD, SignAndSizeForFKData};
126 return {XCOFF::RelocationType::R_TLSML, SignAndSizeForFKData};
128 return {XCOFF::RelocationType::R_POS, SignAndSizeForFKData};
PowerPC TLS Dynamic Call Fixup
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
This represents an "assembler immediate".
virtual std::pair< uint8_t, uint8_t > getRelocTypeAndSignSize(const MCValue &Target, const MCFixup &Fixup, bool IsPCRel) const =0
Target - Wrapper for Target specific information.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
@ fixup_ppc_half16
A 16-bit fixup corresponding to lo16(_foo) or ha16(_foo) for instrs like 'li' or 'addis'.
@ fixup_ppc_half16dq
A 16-bit fixup corresponding to lo16(_foo) with implied 3 zero bits for instrs like 'lxv'.
@ fixup_ppc_half16ds
A 14-bit fixup corresponding to lo16(_foo) with implied 2 zero bits for instrs like 'std'.
@ fixup_ppc_nofixup
Not a true fixup, but ties a symbol to a call to __tls_get_addr for the TLS general and local dynamic...
@ fixup_ppc_br24abs
24-bit absolute relocation for direct branches like 'ba' and 'bla'.
This is an optimization pass for GlobalISel generic memory operations.
std::unique_ptr< MCObjectTargetWriter > createPPCXCOFFObjectWriter(bool Is64Bit)
Construct a PPC XCOFF object writer.
void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
@ FK_Data_8
A eight-byte fixup.
@ FK_Data_4
A four-byte fixup.