39 uint64_t &FixedValue);
45 uint64_t &FixedValue);
49 const MCFragment &Fragment,
unsigned RelocType,
50 const MCSymbol &S, uint64_t FixedValue);
59 uint64_t &FixedValue)
override;
140 void ARMMachObjectWriter::
147 uint64_t &FixedValue) {
150 if (FixupOffset & 0xff000000) {
152 "can not encode offset '0x" +
154 "' in resulting scattered relocation.");
167 "' can not be undefined in a subtraction expression");
174 FixedValue += SecAddr;
181 "symbol '" +
B->getSymbol().getName() +
182 "' can not be undefined in a subtraction expression");
206 unsigned ThumbBit = 0;
207 unsigned MovtBit = 0;
208 switch ((
unsigned)Fixup.
getKind()) {
216 FixedValue &= 0xfffffffe;
220 FixedValue &= 0xfffffffe;
230 ? (FixedValue & 0xffff) : ((FixedValue & 0xffff0000) >> 16);
233 MRE.
r_word0 = ((OtherHalf << 0) |
239 MRE.r_word1 = Value2;
244 MRE.
r_word0 = ((FixupOffset << 0) |
254 void ARMMachObjectWriter::RecordARMScatteredRelocation(
MachObjectWriter *Writer,
262 uint64_t &FixedValue) {
265 if (FixupOffset & 0xff000000) {
267 "can not encode offset '0x" +
269 "' in resulting scattered relocation.");
281 "' can not be undefined in a subtraction expression");
287 FixedValue += SecAddr;
296 "symbol '" +
B->getSymbol().getName() +
297 "' can not be undefined in a subtraction expression");
321 MRE.
r_word0 = ((FixupOffset << 0) |
330 bool ARMMachObjectWriter::requiresExternRelocation(
MachObjectWriter *Writer,
335 uint64_t FixedValue) {
339 int64_t
Value = (int64_t)FixedValue;
371 if (Value > Range || Value < -(Range + 1))
381 uint64_t &FixedValue) {
391 "unsupported relocation on symbol");
400 return RecordARMScatteredHalfRelocation(Writer, Asm, Layout, Fragment,
401 Fixup, Target, FixedValue);
402 return RecordARMScatteredRelocation(Writer, Asm, Layout, Fragment, Fixup,
403 Target, RelocType, Log2Size,
419 Offset += 1 << Log2Size;
422 return RecordARMScatteredRelocation(Writer, Asm, Layout, Fragment, Fixup,
423 Target, RelocType, Log2Size,
430 const MCSymbol *RelSymbol =
nullptr;
435 "not yet implemented");
448 if (requiresExternRelocation(Writer, Asm, *Fragment, RelocType, *A,
474 (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
484 switch ((
unsigned)Fixup.
getKind()) {
488 Value = (FixedValue >> 16) & 0xffff;
492 Value = FixedValue & 0xffff;
497 MREPair.
r_word1 = ((0xffffff << 0) |
507 std::unique_ptr<MCObjectTargetWriter>
510 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.
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.
MCFixupKind getKind() const