26 enum { DefaultEABIVersion = 0x05000000U };
33 ARMELFObjectWriter(uint8_t OSABI);
35 ~ARMELFObjectWriter()
override;
38 const MCFixup &Fixup,
bool IsPCRel)
const override;
40 bool needsRelocateWithSymbol(
const MCSymbol &Sym,
41 unsigned Type)
const override;
45 ARMELFObjectWriter::ARMELFObjectWriter(uint8_t OSABI)
50 ARMELFObjectWriter::~ARMELFObjectWriter() {}
52 bool ARMELFObjectWriter::needsRelocateWithSymbol(
const MCSymbol &Sym,
53 unsigned Type)
const {
61 case ELF::R_ARM_PREL31:
62 case ELF::R_ARM_ABS32:
73 return GetRelocTypeInner(Target, Fixup, IsPCRel);
76 unsigned ARMELFObjectWriter::GetRelocTypeInner(
const MCValue &
Target,
83 switch ((
unsigned)Fixup.
getKind()) {
86 return ELF::R_ARM_NONE;
91 Type = ELF::R_ARM_REL32;
96 Type = ELF::R_ARM_TLS_IE32;
99 Type = ELF::R_ARM_GOT_PREL;
102 Type = ELF::R_ARM_PREL31;
110 Type = ELF::R_ARM_CALL;
113 Type = ELF::R_ARM_TLS_CALL;
116 Type = ELF::R_ARM_CALL;
123 Type = ELF::R_ARM_JUMP24;
126 Type = ELF::R_ARM_THM_JUMP19;
129 Type = ELF::R_ARM_THM_JUMP24;
132 Type = ELF::R_ARM_MOVT_PREL;
135 Type = ELF::R_ARM_MOVW_PREL_NC;
138 Type = ELF::R_ARM_THM_MOVT_PREL;
141 Type = ELF::R_ARM_THM_MOVW_PREL_NC;
144 Type = ELF::R_ARM_THM_JUMP11;
147 Type = ELF::R_ARM_THM_JUMP8;
153 Type = ELF::R_ARM_THM_TLS_CALL;
156 Type = ELF::R_ARM_THM_CALL;
162 switch ((
unsigned)Fixup.
getKind()) {
165 return ELF::R_ARM_NONE;
170 Type = ELF::R_ARM_ABS8;
178 Type = ELF::R_ARM_ABS16;
186 Type = ELF::R_ARM_NONE;
189 Type = ELF::R_ARM_GOT_BREL;
192 Type = ELF::R_ARM_TLS_GD32;
195 Type = ELF::R_ARM_TLS_LE32;
198 Type = ELF::R_ARM_TLS_IE32;
201 Type = ELF::R_ARM_ABS32;
204 Type = ELF::R_ARM_GOTOFF32;
207 Type = ELF::R_ARM_GOT_PREL;
210 Type = ELF::R_ARM_TARGET1;
213 Type = ELF::R_ARM_TARGET2;
216 Type = ELF::R_ARM_PREL31;
219 Type = ELF::R_ARM_SBREL32;
222 Type = ELF::R_ARM_TLS_LDO32;
225 Type = ELF::R_ARM_TLS_CALL;
228 Type = ELF::R_ARM_TLS_GOTDESC;
231 Type = ELF::R_ARM_TLS_LDM32;
234 Type = ELF::R_ARM_TLS_DESCSEQ;
248 Type = ELF::R_ARM_JUMP24;
254 Type = ELF::R_ARM_MOVT_ABS;
257 Type = ELF:: R_ARM_MOVT_BREL;
265 Type = ELF::R_ARM_MOVW_ABS_NC;
268 Type = ELF:: R_ARM_MOVW_BREL_NC;
273 Type = ELF::R_ARM_THM_MOVT_ABS;
276 Type = ELF::R_ARM_THM_MOVW_ABS_NC;
286 bool IsLittleEndian) {
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
This represents an "assembler immediate".
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Defines the object file and target independent interfaces used by the assembler backend to write nati...
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
static unsigned getRelocType(const MCValue &Target, const MCFixupKind FixupKind, const bool IsPCRel)
Translates generic PPC fixup kind to Mach-O/PPC relocation type enum.
Context object for machine code objects.
Function Alias Analysis false
MCObjectWriter * createARMELFObjectWriter(raw_pwrite_stream &OS, uint8_t OSABI, bool IsLittleEndian)
Construct an ELF Mach-O object writer.
The instances of the Type class are immutable: once they are created, they are never changed...
MCSymbolRefExpr::VariantKind getAccessVariant() const
MCFixupKind getKind() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Target - Wrapper for Target specific information.
MCObjectWriter * createELFObjectWriter(MCELFObjectTargetWriter *MOTW, raw_pwrite_stream &OS, bool IsLittleEndian)
Construct a new ELF writer instance.
An abstract base class for streams implementations that also support a pwrite operation.