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;
343 if (Value > Range || Value < -(Range + 1))
353 uint64_t &FixedValue) {
363 "unsupported relocation on symbol");
372 return RecordARMScatteredHalfRelocation(Writer, Asm, Layout, Fragment,
373 Fixup, Target, FixedValue);
374 return RecordARMScatteredRelocation(Writer, Asm, Layout, Fragment, Fixup,
375 Target, RelocType, Log2Size,
391 Offset += 1 << Log2Size;
394 return RecordARMScatteredRelocation(Writer, Asm, Layout, Fragment, Fixup,
395 Target, RelocType, Log2Size,
402 const MCSymbol *RelSymbol =
nullptr;
407 "not yet implemented");
420 if (requiresExternRelocation(Writer, Asm, *Fragment, RelocType, *A,
446 (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
456 switch ((
unsigned)Fixup.
getKind()) {
460 Value = (FixedValue >> 16) & 0xffff;
464 Value = FixedValue & 0xffff;
469 MREPair.
r_word1 = ((0xffffff << 0) |
Instances of this class represent a uniqued identifier for a section in the current translation unit...
const MCSymbol & getSymbol() 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.
This represents an "assembler immediate".
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
uint64_t getSectionAddress(const MCSection *Sec) const
bool getSymbolOffset(const MCSymbol &S, uint64_t &Val) const
Get the offset of the given symbol, as computed in the current layout.
MCObjectWriter * createARMMachObjectWriter(raw_pwrite_stream &OS, bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
Construct an ARM Mach-O object writer.
MCContext & getContext() const
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)...
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)
bool isAbsolute() const
Is this an absolute (as opposed to relocatable) value.
static GCRegistry::Add< OcamlGC > B("ocaml","ocaml 3.10-compatible GC")
bool isThumbFunc(const MCSymbol *Func) const
Check whether a given symbol has been flagged with .thumb_func.
uint32_t getOffset() const
SectionAddrMap & getSectionAddressMap()
INITIALIZE_PASS(HexagonEarlyIfConversion,"hexagon-eif","Hexagon early if conversion", false, false) bool HexagonEarlyIfConversion MachineBasicBlock * SB
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)
void reportError(SMLoc L, const Twine &Msg)
unsigned getOrdinal() const
MCFixupKind getKind() const
const MCSymbolRefExpr * getSymB() const
const MCSymbolRefExpr * getSymA() const
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn...
MCSection * getParent() const
unsigned Log2_32(uint32_t Value)
Log2_32 - This function returns the floor log base 2 of the specified value, -1 if the value is zero...
Target - Wrapper for Target specific information.
const MCExpr * getVariableValue(bool SetUsed=true) const
getVariableValue - Get the value for variable symbols.
MCObjectWriter * createMachObjectWriter(MCMachObjectTargetWriter *MOTW, raw_pwrite_stream &OS, bool IsLittleEndian)
Construct a new Mach-O writer instance.
MCSection & getSection(bool SetUsed=true) const
Get the section associated with a defined, non-absolute symbol.
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.
MCFragment * getFragment(bool SetUsed=true) const
An abstract base class for streams implementations that also support a pwrite operation.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
int64_t getConstant() const
LLVM Value Representation.
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
uint64_t getSymbolAddress(const MCSymbol &S, const MCAsmLayout &Layout) const
static GCRegistry::Add< ErlangGC > A("erlang","erlang-compatible garbage collector")
bool isUndefined(bool SetUsed=true) const
isUndefined - Check if this symbol undefined (i.e., implicitly defined).