36 uint64_t &FixedValue);
42 uint64_t &FixedValue);
51 ARMMachObjectWriter(
bool Is64Bit, uint32_t
CPUType,
145 void ARMMachObjectWriter::
152 uint64_t &FixedValue) {
164 "' can not be undefined in a subtraction expression");
170 FixedValue += SecAddr;
177 "symbol '" + B->getSymbol().getName() +
178 "' can not be undefined in a subtraction expression");
200 unsigned ThumbBit = 0;
201 unsigned MovtBit = 0;
202 switch ((
unsigned)Fixup.
getKind()) {
211 FixedValue &= 0xfffffffe;
216 FixedValue &= 0xfffffffe;
226 uint32_t OtherHalf = MovtBit
227 ? (FixedValue & 0xffff) : ((FixedValue & 0xffff0000) >> 16);
230 MRE.
r_word0 = ((OtherHalf << 0) |
236 MRE.r_word1 = Value2;
241 MRE.
r_word0 = ((FixupOffset << 0) |
251 void ARMMachObjectWriter::RecordARMScatteredRelocation(
MachObjectWriter *Writer,
258 uint64_t &FixedValue) {
270 "' can not be undefined in a subtraction expression");
274 FixedValue += SecAddr;
282 "symbol '" + B->getSymbol().getName() +
283 "' can not be undefined in a subtraction expression");
305 MRE.
r_word0 = ((FixupOffset << 0) |
314 bool ARMMachObjectWriter::requiresExternRelocation(
MachObjectWriter *Writer,
319 uint64_t FixedValue) {
323 int64_t Value = (int64_t)FixedValue;
349 if (Value > Range || Value < -(Range + 1))
360 uint64_t &FixedValue) {
370 "unsupported relocation on symbol");
377 return RecordARMScatteredHalfRelocation(Writer, Asm, Layout, Fragment,
378 Fixup, Target, FixedValue);
379 return RecordARMScatteredRelocation(Writer, Asm, Layout, Fragment, Fixup,
380 Target, Log2Size, FixedValue);
395 Offset += 1 << Log2Size;
397 return RecordARMScatteredRelocation(Writer, Asm, Layout, Fragment, Fixup,
398 Target, Log2Size, FixedValue);
403 unsigned IsExtern = 0;
409 "not yet implemented");
422 if (requiresExternRelocation(Writer, Asm, *Fragment, RelocType, SD,
461 switch ((
unsigned)Fixup.
getKind()) {
467 Value = (FixedValue >> 16) & 0xffff;
473 Value = FixedValue & 0xffff;
478 MREPair.
r_word1 = ((0xffffff << 0) |
491 uint32_t CPUSubtype) {
const MCSymbol & getSymbol() const
MCContext & getContext() const
const MCSymbol & getSymbol() const
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
uint64_t getIndex() const
getIndex - Get the (implementation defined) index.
const MCSection & getSection() const
uint64_t getSymbolAddress(const MCSymbolData *SD, const MCAsmLayout &Layout) const
const MCExpr * getVariableValue() const
getVariableValue() - Get the value for variable symbols.
MCSectionData & getSectionData(const MCSection &Section) const
bool isFixupKindPCRel(const MCAssembler &Asm, unsigned Kind)
uint64_t getSectionAddress(const MCSectionData *SD) const
bool isAbsolute() const
isAbsolute - Is this an absolute (as opposed to relocatable) value.
MCFragment * getFragment() const
uint32_t getOffset() const
SectionAddrMap & getSectionAddressMap()
unsigned getOrdinal() const
MCSectionData * getParent() const
static bool getARMFixupKindMachOInfo(unsigned Kind, unsigned &RelocType, unsigned &Log2Size)
uint32_t getFlags() const
getFlags - Get the (implementation defined) symbol flags.
MCFixupKind getKind() const
const MCSymbolRefExpr * getSymB() const
LLVM_ATTRIBUTE_NORETURN void FatalError(SMLoc L, const Twine &Msg)
MCObjectWriter * createARMMachObjectWriter(raw_ostream &OS, bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
createARMMachObjectWriter - Construct an ARM Mach-O object writer.
MCSymbolData & getSymbolData(const MCSymbol &Symbol) const
const MCSymbolRefExpr * getSymA() const
uint64_t getSymbolOffset(const MCSymbolData *SD) const
Get the offset of the given symbol, as computed in the current layout.
unsigned Log2_32(uint32_t Value)
bool doesSymbolRequireExternRelocation(const MCSymbolData *SD)
StringRef getName() const
getName - Get the symbol name.
uint64_t getFragmentOffset(const MCFragment *F) const
Get the offset of the given fragment inside its containing section.
bool isVariable() const
isVariable - Check if this is a variable symbol.
int64_t getConstant() const
LLVM Value Representation.
void addRelocation(const MCSectionData *SD, MachO::any_relocation_info &MRE)
bool isUndefined() const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
MCObjectWriter * createMachObjectWriter(MCMachObjectTargetWriter *MOTW, raw_ostream &OS, bool IsLittleEndian)
Construct a new Mach-O writer instance.