LLVM 20.0.0git
|
Classes | |
class | GOTTableManager |
Global Offset Table Builder. More... | |
class | PLTTableManager |
Procedure Linkage Table Builder. More... | |
Enumerations | |
enum | EdgeKind_aarch64 : Edge::Kind { Pointer64 = Edge::FirstRelocation , Pointer32 , Delta64 , Delta32 , NegDelta64 , NegDelta32 , Branch26PCRel , TestAndBranch14PCRel , CondBranch19PCRel , MoveWide16 , LDRLiteral19 , ADRLiteral21 , Page21 , PageOffset12 , GotPageOffset15 , RequestGOTAndTransformToPage21 , RequestGOTAndTransformToPageOffset12 , RequestGOTAndTransformToPageOffset15 , RequestGOTAndTransformToDelta32 , RequestTLVPAndTransformToPage21 , RequestTLVPAndTransformToPageOffset12 , RequestTLSDescEntryAndTransformToPage21 , RequestTLSDescEntryAndTransformToPageOffset12 } |
Represents aarch64 fixups and other aarch64-specific edge kinds. More... | |
Functions | |
const char * | getEdgeKindName (Edge::Kind K) |
Returns a string name for the given aarch64 edge. | |
bool | isLoadStoreImm12 (uint32_t Instr) |
bool | isTestAndBranchImm14 (uint32_t Instr) |
bool | isCondBranchImm19 (uint32_t Instr) |
bool | isCompAndBranchImm19 (uint32_t Instr) |
bool | isADR (uint32_t Instr) |
bool | isLDRLiteral (uint32_t Instr) |
unsigned | getPageOffset12Shift (uint32_t Instr) |
bool | isMoveWideImm16 (uint32_t Instr) |
unsigned | getMoveWide16Shift (uint32_t Instr) |
Error | applyFixup (LinkGraph &G, Block &B, const Edge &E, const Symbol *GOTSymbol) |
Apply fixup expression for edge to block content. | |
Symbol & | createAnonymousPointer (LinkGraph &G, Section &PointerSection, Symbol *InitialTarget=nullptr, uint64_t InitialAddend=0) |
Creates a new pointer block in the given section and returns an Anonymous symbol pointing to it. | |
Block & | createPointerJumpStubBlock (LinkGraph &G, Section &StubSection, Symbol &PointerSymbol) |
Create a jump stub block that jumps via the pointer at the given symbol. | |
Symbol & | createAnonymousPointerJumpStub (LinkGraph &G, Section &StubSection, Symbol &PointerSymbol) |
Create a jump stub that jumps via the pointer at the given symbol and an anonymous symbol pointing to it. | |
Variables | |
constexpr uint64_t | PointerSize = 8 |
aarch64 pointer size. | |
const char | NullPointerContent [PointerSize] |
AArch64 null pointer content. | |
const char | PointerJumpStubContent [12] |
Represents aarch64 fixups and other aarch64-specific edge kinds.
Enumerator | |
---|---|
Pointer64 | A plain 64-bit pointer value relocation. Fixup expression: Fixup <- Target + Addend : uint64 |
Pointer32 | A plain 32-bit pointer value relocation. Fixup expression: Fixup <- Target + Addend : uint32 Errors:
|
Delta64 | A 64-bit delta. Delta from the fixup to the target. Fixup expression: Fixup <- Target - Fixup + Addend : int64 |
Delta32 | A 32-bit delta. Delta from the fixup to the target. Fixup expression: Fixup <- Target - Fixup + Addend : int64 Errors:
|
NegDelta64 | A 64-bit negative delta. Delta from target back to the fixup. Fixup expression: Fixup <- Fixup - Target + Addend : int64 |
NegDelta32 | A 32-bit negative delta. Delta from the target back to the fixup. Fixup expression: Fixup <- Fixup - Target + Addend : int32 Errors:
|
Branch26PCRel | A 26-bit PC-relative branch. Represents a PC-relative call or branch to a target within +/-128Mb. The target must be 32-bit aligned. Fixup expression: Fixup <- (Target - Fixup + Addend) >> 2 : int26 Notes: The '26' in the name refers to the number operand bits and follows the naming convention used by the corresponding ELF and MachO relocations. Since the low two bits must be zero (because of the 32-bit alignment of the target) the operand is effectively a signed 28-bit number. Errors:
|
TestAndBranch14PCRel | A 14-bit PC-relative test and branch. Represents a PC-relative test and branch to a target within +/-32Kb. The target must be 32-bit aligned. Fixup expression: Fixup <- (Target - Fixup + Addend) >> 2 : int14 Notes: The '14' in the name refers to the number operand bits and follows the naming convention used by the corresponding ELF relocation. Since the low two bits must be zero (because of the 32-bit alignment of the target) the operand is effectively a signed 16-bit number. Errors:
|
CondBranch19PCRel | A 19-bit PC-relative conditional branch. Represents a PC-relative conditional branch to a target within +/-1Mb. The target must be 32-bit aligned. Fixup expression: Fixup <- (Target - Fixup + Addend) >> 2 : int19 Notes: The '19' in the name refers to the number operand bits and follows the naming convention used by the corresponding ELF relocation. Since the low two bits must be zero (because of the 32-bit alignment of the target) the operand is effectively a signed 21-bit number. Errors:
|
MoveWide16 | A 16-bit slice of the target address (which slice depends on the instruction at the fixup location). Used to fix up MOVK/MOVN/MOVZ instructions. Fixup expression: Fixup <- (Target + Addend) >> Shift : uint16 where Shift is encoded in the instruction at the fixup location. |
LDRLiteral19 | The signed 21-bit delta from the fixup to the target. Typically used to load a pointers at a PC-relative offset of +/- 1Mb. The target must be 32-bit aligned. Fixup expression: Fixup <- (Target - Fixup + Addend) >> 2 : int19 Notes: The '19' in the name refers to the number operand bits and follows the naming convention used by the corresponding ELF relocation. Since the low two bits must be zero (because of the 32-bit alignment of the target) the operand is effectively a signed 21-bit number. Errors:
|
ADRLiteral21 | The signed 21-bit delta from the fixup to the target. Fixup expression: Fixup <- Target - Fixup + Addend : int21 Notes: For ADR fixups. Errors:
|
Page21 | The signed 21-bit delta from the fixup page to the page containing the target. Fixup expression: Fixup <- (((Target + Addend) & ~0xfff) - (Fixup & ~0xfff)) >> 12 : int21 Notes: For ADRP fixups. Errors:
|
PageOffset12 | The 12-bit (potentially shifted) offset of the target within its page. Typically used to fix up LDR immediates. Fixup expression: Fixup <- ((Target + Addend) >> Shift) & 0xfff : uint12 where Shift is encoded in the size field of the instruction. Errors:
|
GotPageOffset15 | The 15-bit offset of the GOT entry from the GOT table. Used for load/store instructions addressing a GOT entry. Fixup expression: Fixup <- ((Target + Addend - Page(GOT))) & 0x7fff) >> 3 : uint12 Errors:
|
RequestGOTAndTransformToPage21 | A GOT entry getter/constructor, transformed to Page21 pointing at the GOT entry for the original target. Indicates that this edge should be transformed into a Page21 targeting the GOT entry for the edge's current target, maintaining the same addend. A GOT entry for the target should be created if one does not already exist. Edges of this kind are usually handled by a GOT builder pass inserted by default. Fixup expression: NONE Errors:
|
RequestGOTAndTransformToPageOffset12 | A GOT entry getter/constructor, transformed to Pageoffset12 pointing at the GOT entry for the original target. Indicates that this edge should be transformed into a PageOffset12 targeting the GOT entry for the edge's current target, maintaining the same addend. A GOT entry for the target should be created if one does not already exist. Edges of this kind are usually handled by a GOT builder pass inserted by default. Fixup expression: NONE Errors:
|
RequestGOTAndTransformToPageOffset15 | A GOT entry getter/constructor, transformed to Pageoffset15 pointing at the GOT entry for the original target. Indicates that this edge should be transformed into a GotPageOffset15 targeting the GOT entry for the edge's current target, maintaining the same addend. A GOT entry for the target should be created if one does not already exist. Fixup expression: NONE Errors:
|
RequestGOTAndTransformToDelta32 | A GOT entry getter/constructor, transformed to Delta32 pointing at the GOT entry for the original target. Indicates that this edge should be transformed into a Delta32/ targeting the GOT entry for the edge's current target, maintaining the same addend. A GOT entry for the target should be created if one does not already exist. Edges of this kind are usually handled by a GOT builder pass inserted by default. Fixup expression: NONE Errors:
|
RequestTLVPAndTransformToPage21 | A TLVP entry getter/constructor, transformed to Page21. Indicates that this edge should be transformed into a Page21 targeting the TLVP entry for the edge's current target. A TLVP entry for the target should be created if one does not already exist. Fixup expression: NONE Errors:
|
RequestTLVPAndTransformToPageOffset12 | A TLVP entry getter/constructor, transformed to PageOffset12. Indicates that this edge should be transformed into a PageOffset12 targeting the TLVP entry for the edge's current target. A TLVP entry for the target should be created if one does not already exist. Fixup expression: NONE Errors:
|
RequestTLSDescEntryAndTransformToPage21 | A TLSDesc entry getter/constructor, transformed to Page21. Indicates that this edge should be transformed into a Page21 targeting the TLSDesc entry for the edge's current target. A TLSDesc entry for the target should be created if one does not already exist. Fixup expression: NONE Errors:
|
RequestTLSDescEntryAndTransformToPageOffset12 | A TLSDesc entry getter/constructor, transformed to PageOffset12. Indicates that this edge should be transformed into a PageOffset12 targeting the TLSDesc entry for the edge's current target. A TLSDesc entry for the target should be created if one does not already exist. Fixup expression: NONE Errors:
|
|
inline |
Apply fixup expression for edge to block content.
Definition at line 465 of file aarch64.h.
References ADRLiteral21, assert(), B, Branch26PCRel, CondBranch19PCRel, Delta32, Delta64, E, G, llvm::jitlink::Symbol::getAddress(), getEdgeKindName(), getMoveWide16Shift(), getPageOffset12Shift(), llvm::orc::ExecutorAddr::getValue(), GotPageOffset15, isADR(), isCompAndBranchImm19(), isCondBranchImm19(), isLDRLiteral(), isMoveWideImm16(), isTestAndBranchImm14(), LDRLiteral19, llvm::jitlink::makeTargetOutOfRangeError(), MoveWide16, NegDelta32, NegDelta64, Page21, PageOffset12, Pointer32, Pointer64, llvm::Error::success(), and TestAndBranch14PCRel.
|
inline |
Creates a new pointer block in the given section and returns an Anonymous symbol pointing to it.
If InitialTarget is given then an Pointer64 relocation will be added to the block pointing at InitialTarget.
The pointer block will have the following default values: alignment: 64-bit alignment-offset: 0 address: highest allowable (~7U)
Definition at line 691 of file aarch64.h.
References B, G, NullPointerContent, and Pointer64.
Referenced by llvm::jitlink::aarch64::GOTTableManager::createEntry().
|
inline |
Create a jump stub that jumps via the pointer at the given symbol and an anonymous symbol pointing to it.
Return the anonymous symbol.
The stub block will be created by createPointerJumpStubBlock.
Definition at line 720 of file aarch64.h.
References createPointerJumpStubBlock(), G, and PointerJumpStubContent.
Referenced by llvm::jitlink::aarch64::PLTTableManager::createEntry().
|
inline |
Create a jump stub block that jumps via the pointer at the given symbol.
The stub block will have the following default values: alignment: 32-bit alignment-offset: 0 address: highest allowable: (~11U)
Definition at line 707 of file aarch64.h.
References B, G, Page21, PageOffset12, and PointerJumpStubContent.
Referenced by createAnonymousPointerJumpStub().
const char * llvm::jitlink::aarch64::getEdgeKindName | ( | Edge::Kind | K | ) |
Returns a string name for the given aarch64 edge.
For debugging purposes only
Definition at line 30 of file aarch64.cpp.
References ADRLiteral21, Branch26PCRel, CondBranch19PCRel, Delta32, Delta64, llvm::jitlink::getGenericEdgeKindName(), GotPageOffset15, LDRLiteral19, MoveWide16, NegDelta32, NegDelta64, Page21, PageOffset12, Pointer32, Pointer64, RequestGOTAndTransformToDelta32, RequestGOTAndTransformToPage21, RequestGOTAndTransformToPageOffset12, RequestGOTAndTransformToPageOffset15, RequestTLSDescEntryAndTransformToPage21, RequestTLSDescEntryAndTransformToPageOffset12, RequestTLVPAndTransformToPage21, RequestTLVPAndTransformToPageOffset12, and TestAndBranch14PCRel.
Referenced by applyFixup().
Definition at line 430 of file aarch64.h.
References isLoadStoreImm12().
Referenced by applyFixup().
Definition at line 414 of file aarch64.h.
Referenced by applyFixup().
Definition at line 409 of file aarch64.h.
Referenced by applyFixup().
Definition at line 404 of file aarch64.h.
Referenced by applyFixup().
Definition at line 419 of file aarch64.h.
Referenced by applyFixup().
Definition at line 394 of file aarch64.h.
Referenced by getPageOffset12Shift().
Definition at line 446 of file aarch64.h.
Referenced by applyFixup(), and getMoveWide16Shift().
Definition at line 399 of file aarch64.h.
Referenced by applyFixup().
AArch64 null pointer content.
Definition at line 21 of file aarch64.cpp.
Referenced by createAnonymousPointer().
Definition at line 24 of file aarch64.cpp.
Referenced by createAnonymousPointerJumpStub(), and createPointerJumpStubBlock().