LLVM 22.0.0git
llvm::jitlink::systemz Namespace Reference

Classes

class  GOTTableManager
 Global Offset Table Builder. More...
class  PLTTableManager
 Procedure Linkage Table Builder. More...

Enumerations

enum  EdgeKind_systemz : Edge::Kind {
  Pointer64 = Edge::FirstRelocation , Pointer32 , Pointer20 , Pointer16 ,
  Pointer12 , Pointer8 , Delta64 , Delta32 ,
  Delta16 , Delta32dbl , Delta24dbl , Delta16dbl ,
  Delta12dbl , NegDelta64 , NegDelta32 , DeltaPLT32dbl ,
  DeltaPLT24dbl , DeltaPLT16dbl , DeltaPLT12dbl , DeltaPLT64 ,
  DeltaPLT32 , Delta64PLTFromGOT , Delta32PLTFromGOT , Delta16PLTFromGOT ,
  Delta64FromGOT , Delta32FromGOT , Delta16FromGOT , Delta20FromGOT ,
  Delta12FromGOT , RequestGOTAndTransformToDelta64FromGOT , RequestGOTAndTransformToDelta32FromGOT , RequestGOTAndTransformToDelta20FromGOT ,
  RequestGOTAndTransformToDelta16FromGOT , RequestGOTAndTransformToDelta12FromGOT , RequestGOTAndTransformToDelta32dbl , Delta32GOTBase ,
  Delta32dblGOTBase
}
 Represents systemz fixups and other systemz-specific edge kinds. More...

Functions

const chargetEdgeKindName (Edge::Kind K)
 Returns a string name for the given systemz edge.
Error applyFixup (LinkGraph &G, Block &B, const Edge &E, const Symbol *GOTSymbol)
 Apply fixup expression for edge to block content.
ArrayRef< chargetGOTEntryBlockContent (LinkGraph &G)
ArrayRef< chargetStubBlockContent (LinkGraph &G)
SymbolcreateAnonymousPointer (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.
BlockcreatePointerJumpStubBlock (LinkGraph &G, Section &StubSection, Symbol &PointerSymbol)
 Create a jump stub block that jumps via the pointer at the given symbol.
SymbolcreateAnonymousPointerJumpStub (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

const char NullPointerContent [8]
 SystemZ null pointer content.
constexpr size_t StubEntrySize = 8
 SystemZ pointer jump stub content.
const char Pointer64JumpStubContent [StubEntrySize]

Enumeration Type Documentation

◆ EdgeKind_systemz

Represents systemz fixups and other systemz-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:

  • The target must reside in the low 32-bits of the address space, otherwise an out-of-range error will be returned.
Pointer20 

A plain 20-bit pointer value relocation.

Fixup expression: Fixup <- Target + Addend : uint20

Errors:

  • The target must reside in the low 20-bits of the address space, otherwise an out-of-range error will be returned.
Pointer16 

A plain 16-bit pointer value relocation.

Fixup expression: Fixup <- Target + Addend : uint16

Errors:

  • The target must reside in the low 16-bits of the address space, otherwise an out-of-range error will be returned.
Pointer12 

A plain 12-bit pointer value relocation.

Fixup expression: Fixup <- Target + Addend : uint12

Errors:

  • The target must reside in the low 12-bits of the address space, otherwise an out-of-range error will be returned.
Pointer8 

A plain 8-bit pointer value relocation.

Fixup expression: Fixup <- Target + Addend : uint8

Errors:

  • The target must reside in the low 8-bits of the address space, otherwise an out-of-range error will be returned.
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 : int32

Errors:

  • The result of the fixup expression must fit into an int32, otherwise an out-of-range error will be returned.
Delta16 

A 16-bit delta.

Delta from the fixup to the target.

Fixup expression: Fixup <- Target - Fixup + Addend : int16

Errors:

  • The result of the fixup expression must fit into an int16, otherwise an out-of-range error will be returned.
Delta32dbl 

A 32-bit delta shifted by 1.

Delta from the fixup to the target.

Fixup expression: Fixup <- (Target - Fixup + Addend) >> 1 : int32

Errors:

  • The result of the fixup expression before shifting right by 1 must fit into an int33, otherwise an out-of-range error will be returned.
  • The result of the fixup expression before shifting right by 1 must be multiple of 2, otherwise an alignment error will be returned.
Delta24dbl 

A 24-bit delta shifted by 1.

Delta from the fixup to the target.

Fixup expression: Fixup <- (Target - Fixup + Addend) >> 1 : int24

Errors:

  • The result of the fixup expression before shifting right by 1 must fit into an int25, otherwise an out-of-range error will be returned.
  • The result of the fixup expression before shifting right by 1 must be multiple of 2, otherwise an alignment error will be returned.
Delta16dbl 

A 16-bit delta shifted by 1.

Delta from the fixup to the target.

Fixup expression: Fixup <- (Target - Fixup + Addend) >> 1 : int16

Errors:

  • The result of the fixup expression before shifting right by 1 must fit into an int17, otherwise an out-of-range error will be returned.
  • The result of the fixup expression before shifting right by 1 must be multiple of 2, otherwise an alignment error will be returned.
Delta12dbl 

A 12-bit delta shifted by 1.

Delta from the fixup to the target.

Fixup expression: Fixup <- (Target - Fixup + Addend) >> 1 : int12

Errors:

  • The result of the fixup expression before shifting right by 1 must fit into an int13, otherwise an out-of-range error will be returned.
  • The result of the fixup expression before shifting right by 1 must be multiple of 2, otherwise an alignment error will be returned.
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:

  • The result of the fixup expression must fit into an int32, otherwise an out-of-range error will be returned.
DeltaPLT32dbl 

A 32-bit Delta shifted by 1.

Delta from the fixup to the PLT slot for the target. This will lead to creation of a PLT stub.

Fixup expression: Fixup <- (Target - Fixup + Addend) >> 1 : int32

Errors:

  • The result of the fixup expression before shifting right by 1 must fit into an int33, otherwise an out-of-range error will be returned.
  • The result of the fixup expression before shifting right by 1 must be multiple of 2, otherwise an alignment error will be returned.
DeltaPLT24dbl 

A 24-bit Delta shifted by 1.

Delta from the fixup to the PLT slot for the target. This will lead to creation of a PLT stub.

Fixup expression: Fixup <- (Target - Fixup + Addend) >> 1 : int24

Errors:

  • The result of the fixup expression before shifting right by 1 must fit into an int25, otherwise an out-of-range error will be returned.
  • The result of the fixup expression before shifting right by 1 must be multiple of 2, otherwise an alignment error will be returned.
DeltaPLT16dbl 

A 16-bit Delta shifted by 1.

Delta from the fixup to the PLT slot for the target. This will lead to creation of a PLT stub.

Fixup expression: Fixup <- (Target - Fixup + Addend) >> 1 : int16

Errors:

  • The result of the fixup expression before shifting right by 1 must fit into an int17, otherwise an out-of-range error will be returned.
  • The result of the fixup expression before shifting right by 1 must be multiple of 2, otherwise an alignment error will be returned.
DeltaPLT12dbl 

A 12-bit Delta shifted by 1.

Delta from the fixup to the PLT slot for the target. This will lead to creation of a PLT stub.

Fixup expression: Fixup <- (Target - Fixup + Addend) >> 1 : int12

Errors:

  • The result of the fixup expression before shifting right by 1 must fit into an int13, otherwise an out-of-range error will be returned.
  • The result of the fixup expression before shifting right by 1 must be multiple of 2, otherwise an alignment error will be returned.
DeltaPLT64 

A 64-bit Delta.

Delta from the fixup to the PLT slot for the target. This will lead to creation of a PLT stub.

Fixup expression: Fixup <- Target - Fixup + Addend : int64

DeltaPLT32 

A 32-bit Delta.

Delta from the fixup to the PLT slot for the target. This will lead to creation of a PLT stub.

Fixup expression: Fixup <- Target - Fixup + Addend : int32

Errors:

  • The result of the fixup expression must fit into an int32, otherwise an out-of-range error will be returned.
Delta64PLTFromGOT 

A 64-bit offset from GOT to PLT.

Fixup expression: Fixup <- Target - GOTBase + Addend : int64

Errors:

  • ASSERTION Failure to a null pointer GOTSymbol, which the GOT section symbol was not been defined.
Delta32PLTFromGOT 

A 32-bit offset from GOT to PLT.

Fixup expression: Fixup <- Target - GOTBase + Addend : int32

Errors:

  • ASSERTION Failure to a null pointer GOTSymbol, which the GOT section symbol was not been defined.
  • The result of the fixup expression must fit into an int32, otherwise an out-of-range error will be returned.
Delta16PLTFromGOT 

A 16-bit offset from GOT to PLT.

Fixup expression: Fixup <- Target - GOTBase + Addend : int16

Errors:

  • ASSERTION Failure to a null pointer GOTSymbol, which the GOT section symbol was not been defined.
  • The result of the fixup expression must fit into an int16, otherwise an out-of-range error will be returned.
Delta64FromGOT 

A 64-bit offset from GOT.

Fixup expression: Fixup <- Target - GOTBase + Addend : int64

Errors:

  • ASSERTION Failure to a null pointer GOTSymbol, which the GOT section symbol was not been defined.
Delta32FromGOT 

A 32-bit offset from GOT.

Fixup expression: Fixup <- Target - GOTBase + Addend : int32

Errors:

  • ASSERTION Failure to a null pointer GOTSymbol, which the GOT section symbol was not been defined.
  • The result of the fixup expression must fit into an int32, otherwise an out-of-range error will be returned.
Delta16FromGOT 

A 16-bit offset from GOT.

Fixup expression: Fixup <- Target - GOTBase + Addend : int16

Errors:

  • ASSERTION Failure to a null pointer GOTSymbol, which the GOT section symbol was not been defined.
  • The result of the fixup expression must fit into an int16, otherwise an out-of-range error will be returned.
Delta20FromGOT 

A 20-bit offset from GOT.

Fixup expression: Fixup <- Target - GOTBase + Addend : int20

Errors:

  • ASSERTION Failure to a null pointer GOTSymbol, which the GOT section symbol was not been defined.
  • The result of the fixup expression must fit into an int16, otherwise an out-of-range error will be returned.
Delta12FromGOT 

A 12-bit offset from GOT.

Fixup expression: Fixup <- Target - GOTBase + Addend : int12

Errors:

  • ASSERTION Failure to a null pointer GOTSymbol, which the GOT section symbol was not been defined.
  • The result of the fixup expression must fit into an int16, otherwise an out-of-range error will be returned.
RequestGOTAndTransformToDelta64FromGOT 

A GOT entry getter/constructor, transformed to Delta64FromGOT pointing at the GOT entry for the original target.

Indicates that this edge should be transformed into a Delta64FromGOT 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:

  • ASSERTION Failure to handle edges of this kind prior to the fixup
RequestGOTAndTransformToDelta32FromGOT 

A GOT entry getter/constructor, transformed to Delta32FromGOT pointing at the GOT entry for the original target.

Indicates that this edge should be transformed into a Delta32FromGOT 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:

  • ASSERTION Failure to handle edges of this kind prior to the fixup
RequestGOTAndTransformToDelta20FromGOT 

A GOT entry getter/constructor, transformed to Delta20FromGOT pointing at the GOT entry for the original target.

Indicates that this edge should be transformed into a Delta20FromGOT 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:

  • ASSERTION Failure to handle edges of this kind prior to the fixup
RequestGOTAndTransformToDelta16FromGOT 

A GOT entry getter/constructor, transformed to Delta16FromGOT pointing at the GOT entry for the original target.

Indicates that this edge should be transformed into a Delta16FromGOT 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:

  • ASSERTION Failure to handle edges of this kind prior to the fixup
RequestGOTAndTransformToDelta12FromGOT 

A GOT entry getter/constructor, transformed to Delta12FromGOT pointing at the GOT entry for the original target.

Indicates that this edge should be transformed into a Delta12FromGOT 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:

  • ASSERTION Failure to handle edges of this kind prior to the fixup phase will result in an assert/unreachable during the fixup phase.
RequestGOTAndTransformToDelta32dbl 

A GOT entry getter/constructor, transformed to Delta32dbl pointing at the GOT entry for the original target.

Indicates that this edge should be transformed into a Delta32dbl 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:

  • ASSERTION Failure to handle edges of this kind prior to the fixup phase will result in an assert/unreachable during the fixup phase.
Delta32GOTBase 

A 32-bit Delta to GOT base.

Fixup expression: Fixup <- GOTBase - Fixup + Addend : int32

Errors:

  • ASSERTION Failure to a null pointer GOTSymbol, which the GOT section symbol was not been defined.
  • The result of the fixup expression must fit into an int32, otherwise an out-of-range error will be returned.
Delta32dblGOTBase 

A 32-bit Delta to GOT base shifted by 1.

Fixup expression: Fixup <- (GOTBase - Fixup + Addend) >> 1 : int32

Errors:

  • ASSERTION Failure to a null pointer GOTSymbol, which the GOT section symbol was not been defined.
  • The result of the fixup expression before shifting right by 1 must fit into an int33, otherwise an out-of-range error will be returned.
  • The result of the fixup expression before shifting right by 1 must be multiple of 2, otherwise an alignment error will be returned.

Definition at line 26 of file systemz.h.

Function Documentation

◆ applyFixup()

◆ createAnonymousPointer()

Symbol & llvm::jitlink::systemz::createAnonymousPointer ( LinkGraph & G,
Section & PointerSection,
Symbol * InitialTarget = nullptr,
uint64_t InitialAddend = 0 )
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.

Definition at line 776 of file systemz.h.

References B(), G, getGOTEntryBlockContent(), and Pointer64.

Referenced by llvm::jitlink::systemz::GOTTableManager::createEntry(), and llvm::jitlink::getAnonymousPointerCreator().

◆ createAnonymousPointerJumpStub()

Symbol & llvm::jitlink::systemz::createAnonymousPointerJumpStub ( LinkGraph & G,
Section & StubSection,
Symbol & PointerSymbol )
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 803 of file systemz.h.

References createPointerJumpStubBlock(), G, and StubEntrySize.

Referenced by llvm::jitlink::systemz::PLTTableManager::createEntry(), and llvm::jitlink::getPointerJumpStubCreator().

◆ createPointerJumpStubBlock()

Block & llvm::jitlink::systemz::createPointerJumpStubBlock ( LinkGraph & G,
Section & StubSection,
Symbol & PointerSymbol )
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: 16-bit alignment-offset: 0

Definition at line 791 of file systemz.h.

References B(), Delta32dbl, G, and getStubBlockContent().

Referenced by createAnonymousPointerJumpStub().

◆ getEdgeKindName()

◆ getGOTEntryBlockContent()

ArrayRef< char > llvm::jitlink::systemz::getGOTEntryBlockContent ( LinkGraph & G)
inline

Definition at line 753 of file systemz.h.

References G, and NullPointerContent.

Referenced by createAnonymousPointer().

◆ getStubBlockContent()

ArrayRef< char > llvm::jitlink::systemz::getStubBlockContent ( LinkGraph & G)
inline

Definition at line 766 of file systemz.h.

References G, Pointer64JumpStubContent, and StubEntrySize.

Referenced by createPointerJumpStubBlock().

Variable Documentation

◆ NullPointerContent

const char llvm::jitlink::systemz::NullPointerContent
Initial value:
= {0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00}

SystemZ null pointer content.

Definition at line 21 of file systemz.cpp.

Referenced by getGOTEntryBlockContent().

◆ Pointer64JumpStubContent

const char llvm::jitlink::systemz::Pointer64JumpStubContent
Initial value:
= {
static_cast<char>(0xC4u),
0x18,
0x00,
0x00,
0x00,
0x00,
static_cast<char>(0x07u),
static_cast<char>(0xF1u),
}

Definition at line 24 of file systemz.cpp.

Referenced by getStubBlockContent().

◆ StubEntrySize

size_t llvm::jitlink::systemz::StubEntrySize = 8
constexpr

SystemZ pointer jump stub content.

Contains the instruction sequence for an indirect jump via an in-memory pointer: lgrl r1, ptr j r1

Definition at line 764 of file systemz.h.

Referenced by createAnonymousPointerJumpStub(), and getStubBlockContent().