38 uint64_t &FixedValue);
44 uint64_t &FixedValue);
48 const MCFragment &Fragment,
unsigned RelocType,
49 const MCSymbol &S, uint64_t FixedValue);
58 uint64_t &FixedValue)
override;
139 void ARMMachObjectWriter::
146 uint64_t &FixedValue) {
149 if (FixupOffset & 0xff000000) {
151 "can not encode offset '0x" +
153 "' in resulting scattered relocation.");
166 "' can not be undefined in a subtraction expression");
173 FixedValue += SecAddr;
180 "symbol '" +
B->getSymbol().getName() +
181 "' can not be undefined in a subtraction expression");
205 unsigned ThumbBit = 0;
206 unsigned MovtBit = 0;
215 FixedValue &= 0xfffffffe;
219 FixedValue &= 0xfffffffe;
229 ? (FixedValue & 0xffff) : ((FixedValue & 0xffff0000) >> 16);
232 MRE.
r_word0 = ((OtherHalf << 0) |
238 MRE.r_word1 = Value2;
243 MRE.
r_word0 = ((FixupOffset << 0) |
253 void ARMMachObjectWriter::RecordARMScatteredRelocation(
MachObjectWriter *Writer,
261 uint64_t &FixedValue) {
264 if (FixupOffset & 0xff000000) {
266 "can not encode offset '0x" +
268 "' in resulting scattered relocation.");
280 "' can not be undefined in a subtraction expression");
286 FixedValue += SecAddr;
295 "symbol '" +
B->getSymbol().getName() +
296 "' can not be undefined in a subtraction expression");
320 MRE.
r_word0 = ((FixupOffset << 0) |
329 bool ARMMachObjectWriter::requiresExternRelocation(
MachObjectWriter *Writer,
334 uint64_t FixedValue) {
338 int64_t
Value = (int64_t)FixedValue;
370 if (Value > Range || Value < -(Range + 1))
380 uint64_t &FixedValue) {
390 "unsupported relocation on symbol");
399 return RecordARMScatteredHalfRelocation(Writer, Asm, Layout, Fragment,
400 Fixup, Target, FixedValue);
401 return RecordARMScatteredRelocation(Writer, Asm, Layout, Fragment, Fixup,
402 Target, RelocType, Log2Size,
418 Offset += 1 << Log2Size;
421 return RecordARMScatteredRelocation(Writer, Asm, Layout, Fragment, Fixup,
422 Target, RelocType, Log2Size,
429 const MCSymbol *RelSymbol =
nullptr;
434 "not yet implemented");
447 if (requiresExternRelocation(Writer, Asm, *Fragment, RelocType, *A,
473 (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
487 Value = (FixedValue >> 16) & 0xffff;
491 Value = FixedValue & 0xffff;
496 MREPair.
r_word1 = ((0xffffff << 0) |
506 std::unique_ptr<MCObjectTargetWriter>
509 return std::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.
This class represents lattice values for constants.
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
const std::string to_hexString(uint64_t Value, bool UpperCase=true)
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.
unsigned getTargetKind() const
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
MCFixupKind getKind() const