37 uint64_t &FixedValue);
43 uint64_t &FixedValue);
47 const MCFragment &Fragment,
unsigned RelocType,
48 const MCSymbol &S, uint64_t FixedValue);
57 uint64_t &FixedValue)
override;
138 void ARMMachObjectWriter::
145 uint64_t &FixedValue) {
156 "' can not be undefined in a subtraction expression");
163 FixedValue += SecAddr;
170 "symbol '" +
B->getSymbol().getName() +
171 "' can not be undefined in a subtraction expression");
195 unsigned ThumbBit = 0;
196 unsigned MovtBit = 0;
197 switch ((
unsigned)Fixup.
getKind()) {
205 FixedValue &= 0xfffffffe;
209 FixedValue &= 0xfffffffe;
219 ? (FixedValue & 0xffff) : ((FixedValue & 0xffff0000) >> 16);
222 MRE.
r_word0 = ((OtherHalf << 0) |
228 MRE.r_word1 = Value2;
233 MRE.
r_word0 = ((FixupOffset << 0) |
243 void ARMMachObjectWriter::RecordARMScatteredRelocation(
MachObjectWriter *Writer,
251 uint64_t &FixedValue) {
261 "' can not be undefined in a subtraction expression");
267 FixedValue += SecAddr;
276 "symbol '" +
B->getSymbol().getName() +
277 "' can not be undefined in a subtraction expression");
301 MRE.
r_word0 = ((FixupOffset << 0) |
310 bool ARMMachObjectWriter::requiresExternRelocation(
MachObjectWriter *Writer,
315 uint64_t FixedValue) {
319 int64_t
Value = (int64_t)FixedValue;
351 if (Value > Range || Value < -(Range + 1))
361 uint64_t &FixedValue) {
371 "unsupported relocation on symbol");
380 return RecordARMScatteredHalfRelocation(Writer, Asm, Layout, Fragment,
381 Fixup, Target, FixedValue);
382 return RecordARMScatteredRelocation(Writer, Asm, Layout, Fragment, Fixup,
383 Target, RelocType, Log2Size,
399 Offset += 1 << Log2Size;
402 return RecordARMScatteredRelocation(Writer, Asm, Layout, Fragment, Fixup,
403 Target, RelocType, Log2Size,
410 const MCSymbol *RelSymbol =
nullptr;
415 "not yet implemented");
428 if (requiresExternRelocation(Writer, Asm, *Fragment, RelocType, *A,
454 (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
464 switch ((
unsigned)Fixup.
getKind()) {
468 Value = (FixedValue >> 16) & 0xffff;
472 Value = FixedValue & 0xffff;
477 MREPair.
r_word1 = ((0xffffff << 0) |
487 std::unique_ptr<MCObjectTargetWriter>
490 return llvm::make_unique<ARMMachObjectWriter>(Is64Bit,
CPUType, CPUSubtype);
Instances of this class represent a uniqued identifier for a section in the current translation unit...
uint64_t getSymbolAddress(const MCSymbol &S, const MCAsmLayout &Layout) const
bool doesSymbolRequireExternRelocation(const MCSymbol &S)
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(Error Err, bool gen_crash_diag=true)
Report a serious error, calling any installed error handler.
Compute iterated dominance frontiers using a linear time algorithm.
bool isVariable() const
isVariable - Check if this is a variable symbol.
This represents an "assembler immediate".
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
bool isAbsolute() const
Is this an absolute (as opposed to relocatable) value.
unsigned getOrdinal() const
Encode information on a single operation to perform on a byte sequence (e.g., an encoded instruction)...
MCContext & getContext() const
int64_t getConstant() const
const MCSymbolRefExpr * getSymB() const
Encapsulates the layout of an assembly file at a particular point in time.
Represent a reference to a symbol from inside an expression.
bool isFixupKindPCRel(const MCAssembler &Asm, unsigned Kind)
void addRelocation(const MCSymbol *RelSymbol, const MCSection *Sec, MachO::any_relocation_info &MRE)
SectionAddrMap & getSectionAddressMap()
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
The instances of the Type class are immutable: once they are created, they are never changed...
static bool getARMFixupKindMachOInfo(unsigned Kind, unsigned &RelocType, unsigned &Log2Size)
bool getSymbolOffset(const MCSymbol &S, uint64_t &Val) const
Get the offset of the given symbol, as computed in the current layout.
bool isTemporary() const
isTemporary - Check if this is an assembler temporary symbol.
const MCSymbolRefExpr * getSymA() const
void reportError(SMLoc L, const Twine &Msg)
uint32_t getOffset() const
uint64_t getFragmentOffset(const MCFragment *F) const
Get the offset of the given fragment inside its containing section.
PowerPC TLS Dynamic Call Fixup
const MCSymbol & getSymbol() const
bool isUndefined(bool SetUsed=true) const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).
MCFragment * getFragment(bool SetUsed=true) const
unsigned Log2_32(uint32_t Value)
Return the floor log base 2 of the specified value, -1 if the value is zero.
Target - Wrapper for Target specific information.
bool isThumbFunc(const MCSymbol *Func) const
Check whether a given symbol has been flagged with .thumb_func.
MCSection * getParent() const
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
std::unique_ptr< MCObjectTargetWriter > createARMMachObjectWriter(bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
Construct an ARM Mach-O object writer.
uint64_t getSectionAddress(const MCSection *Sec) const
StringRef getName() const
getName - Get the symbol name.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
const MCExpr * getVariableValue(bool SetUsed=true) const
getVariableValue - Get the value for variable symbols.
LLVM Value Representation.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
MCFixupKind getKind() const