36 bool getAArch64FixupKindMachOInfo(
const MCFixup &Fixup,
unsigned &RelocType,
47 uint64_t &FixedValue)
override;
52 bool AArch64MachObjectWriter::getAArch64FixupKindMachOInfo(
58 switch ((
unsigned)Fixup.
getKind()) {
104 "ADR/ADRP relocations must be GOT relative");
152 void AArch64MachObjectWriter::recordRelocation(
155 uint64_t &FixedValue) {
160 unsigned Log2Size = 0;
165 const MCSymbol *RelSymbol =
nullptr;
171 FixedValue += FixupOffset;
184 "conditional branch requires assembler-local" 195 "Invalid relocation on conditional branch!");
199 if (!getAArch64FixupKindMachOInfo(Fixup, Type, Target.
getSymA(), Log2Size,
214 "PC relative absolute relocation!");
239 MRE.
r_word1 = (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
246 "unsupported relocation of modified symbol");
253 "unsupported pc-relative relocation of " 267 "unsupported relocation of local symbol '" + A->
getName() +
268 "'. Must have non-local symbol earlier in section.");
274 "unsupported relocation of local symbol '" + B->
getName() +
275 "'. Must have non-local symbol earlier in section.");
279 if (A_Base == B_Base && A_Base) {
281 Fixup.
getLoc(),
"unsupported relocation with identical base");
296 MRE.
r_word1 = (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
306 bool CanUseLocalRelocation =
308 if (Symbol->
isTemporary() && (Value || !CanUseLocalRelocation)) {
314 "unsupported relocation of local symbol '" + Symbol->
getName() +
315 "'. Must have non-local symbol earlier in section.");
348 if (!CanUseLocalRelocation) {
351 "unsupported relocation of local symbol '" + Symbol->
getName() +
352 "'. Must have non-local symbol earlier in section.");
366 "This constant variable should have been expanded during evaluation");
377 assert((Value & 0xff000000) == 0 &&
"Added relocation out of range!");
382 (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
403 (Index << 0) | (IsPCRel << 24) | (Log2Size << 25) | (Type << 28);
407 std::unique_ptr<MCObjectTargetWriter>
409 return llvm::make_unique<AArch64MachObjectWriter>(
CPUType, CPUSubtype);
const MCAsmInfo * getAsmInfo() const
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 hasAttribute(unsigned Value) const
void setUsedInReloc() const
This represents a section on a Mach-O system (used by Mac OS X).
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 ...
VariantKind getKind() const
std::unique_ptr< MCObjectTargetWriter > createAArch64MachObjectWriter(uint32_t CPUType, uint32_t CPUSubtype)
static bool canUseLocalRelocation(const MCSectionMachO &Section, const MCSymbol &Symbol, unsigned Log2Size)
bool isAbsolute() const
Is this an absolute (as opposed to relocatable) value.
block Block Frequency true
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.
bool isInSection() const
isInSection - Check if this symbol is defined in some section (i.e., it is defined but not absolute)...
Represent a reference to a symbol from inside an expression.
StringRef getSectionName() const
bool isFixupKindPCRel(const MCAssembler &Asm, unsigned Kind)
void addRelocation(const MCSymbol *RelSymbol, const MCSection *Sec, MachO::any_relocation_info &MRE)
StringRef getSegmentName() const
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...
bool getSymbolOffset(const MCSymbol &S, uint64_t &Val) const
Get the offset of the given symbol, as computed in the current layout.
virtual bool isSectionAtomizableBySymbols(const MCSection &Section) const
True if the section is atomized using the symbols in it.
const MCSymbol * getAtom(const MCSymbol &S) const
Find the symbol which defines the atom containing the given symbol, or null if there is no such symbo...
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
S_CSTRING_LITERALS - Section with literal C strings.
MachO::SectionType getType() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
uint64_t getFragmentOffset(const MCFragment *F) const
Get the offset of the given fragment inside its containing section.
uint64_t getFragmentAddress(const MCFragment *Fragment, const MCAsmLayout &Layout) const
const MCSymbol & getSymbol() const
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.
MCSection * getParent() const
MCSection & getSection() const
Get the section associated with a defined, non-absolute symbol.
S_ATTR_DEBUG - A debug section.
StringRef getName() const
getName - Get the symbol name.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
MCFixupKind getKind() const