LLVM: lib/Target/AArch64/AArch64TargetObjectFile.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

22using namespace llvm;

23using namespace dwarf;

24

25void AArch64_ELFTargetObjectFile::Initialize(MCContext &Ctx,

30

31

32

34

35

36

37

38 if (TM.getMCSubtargetInfo()->hasFeature(AArch64::FeatureExecuteOnly)) {

41 }

42}

43

49 MMI);

50 return;

51 }

53

54 constexpr uint16_t Discriminator = 0x7EAD;

57}

58

68

72

76

77

78

79

81 const MCSymbol *Sym = TM.getSymbol(GV);

88 }

89

91 GV, Encoding, TM, MMI, Streamer);

92}

93

97 return TM.getSymbol(GV);

98}

99

104 "Arch64 does not support GOT PC rel with extra offset");

105

106

113}

114

122

123template

126 MachineModuleInfoTarget &TargetMMI, const MCSymbol *RawSym,

129

130 MCSymbol *StubSym = Ctx.getOrCreateSymbol(

131 DL.getLinkerPrivateGlobalPrefix() + RawSym->getName() +

133 Twine(Discriminator));

134

135 const MCExpr *&StubAuthPtrRef = TargetMMI.getAuthPtrStubEntry(StubSym);

136

137 if (StubAuthPtrRef)

138 return StubSym;

139

141

142 StubAuthPtrRef =

144 false, Ctx);

145 return StubSym;

146}

147

155

161 Key, Discriminator);

162}

163

168 return true;

169 return false;

170}

171

180

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

static MCSymbol * getAuthPtrSlotSymbolHelper(MCContext &Ctx, const TargetMachine &TM, MachineModuleInfo *MMI, MachineModuleInfoTarget &TargetMMI, const MCSymbol *RawSym, AArch64PACKey::ID Key, uint16_t Discriminator)

Definition AArch64TargetObjectFile.cpp:124

static bool isExecuteOnlyFunction(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM)

Definition AArch64TargetObjectFile.cpp:164

MachineBasicBlock MachineBasicBlock::iterator DebugLoc DL

This file contains constants used for implementing Dwarf debug support.

Module.h This file contains the declarations for the Module class.

static const AArch64AuthMCExpr * create(const MCExpr *Expr, uint16_t Discriminator, AArch64PACKey::ID Key, bool HasAddressDiversity, MCContext &Ctx, SMLoc Loc=SMLoc())

MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override

Targets should implement this method to assign a section to globals with an explicit section specfied...

Definition AArch64TargetObjectFile.cpp:172

void emitPersonalityValueImpl(MCStreamer &Streamer, const DataLayout &DL, const MCSymbol *Sym, const MachineModuleInfo *MMI) const override

Definition AArch64TargetObjectFile.cpp:44

const MCExpr * getIndirectSymViaGOTPCRel(const GlobalValue *GV, const MCSymbol *Sym, const MCValue &MV, int64_t Offset, MachineModuleInfo *MMI, MCStreamer &Streamer) const override

Get the target specific PC relative GOT entry relocation.

Definition AArch64TargetObjectFile.cpp:59

MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override

Definition AArch64TargetObjectFile.cpp:181

MCSymbol * getAuthPtrSlotSymbol(const TargetMachine &TM, MachineModuleInfo *MMI, const MCSymbol *RawSym, AArch64PACKey::ID Key, uint16_t Discriminator) const

Definition AArch64TargetObjectFile.cpp:148

MCSymbol * getAuthPtrSlotSymbol(const TargetMachine &TM, MachineModuleInfo *MMI, const MCSymbol *RawSym, AArch64PACKey::ID Key, uint16_t Discriminator) const

Definition AArch64TargetObjectFile.cpp:156

AArch64_MachoTargetObjectFile()

Definition AArch64TargetObjectFile.cpp:69

const MCExpr * getIndirectSymViaGOTPCRel(const GlobalValue *GV, const MCSymbol *Sym, const MCValue &MV, int64_t Offset, MachineModuleInfo *MMI, MCStreamer &Streamer) const override

Get the target specific PC relative GOT entry relocation.

Definition AArch64TargetObjectFile.cpp:100

void getNameWithPrefix(SmallVectorImpl< char > &OutName, const GlobalValue *GV, const TargetMachine &TM) const override

Definition AArch64TargetObjectFile.cpp:115

MCSymbol * getCFIPersonalitySymbol(const GlobalValue *GV, const TargetMachine &TM, MachineModuleInfo *MMI) const override

Definition AArch64TargetObjectFile.cpp:94

const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const override

Return an MCExpr to use for a reference to the specified global variable from exception handling info...

Definition AArch64TargetObjectFile.cpp:73

A parsed version of the target data layout string in and methods for querying it.

static const MCBinaryExpr * createAdd(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx, SMLoc Loc=SMLoc())

static const MCBinaryExpr * createSub(const MCExpr *LHS, const MCExpr *RHS, MCContext &Ctx)

static LLVM_ABI const MCConstantExpr * create(int64_t Value, MCContext &Ctx, bool PrintInHex=false, unsigned SizeInBytes=0)

Context object for machine code objects.

LLVM_ABI MCSymbol * createTempSymbol()

Create a temporary symbol with a unique name.

Base class for the full range of assembler expressions which are needed for parsing.

MCSection * TextSection

Section directive for standard text.

MCContext & getContext() const

Instances of this class represent a uniqued identifier for a section in the current translation unit.

Streaming machine code generation interface.

virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())

Emit a label for Symbol into the current section.

MCTargetStreamer * getTargetStreamer()

static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())

MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...

StringRef getName() const

getName - Get the symbol name.

int64_t getConstant() const

MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation for ELF targets.

bool hasSignedPersonality() const

MachineModuleInfoMachO - This is a MachineModuleInfoImpl implementation for MachO targets.

This class contains meta information specific to a module.

const Module * getModule() const

Ty & getObjFileInfo()

Keep track of various per-module pieces of information for backends that would like to do so.

LLVM_ABI void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const

Print the appropriate prefix and the specified global variable's name.

const DataLayout & getDataLayout() const

Get the data layout for the module's target platform.

SectionKind - This is a simple POD value that classifies the properties of a section.

static SectionKind getExecuteOnly()

This class consists of common code factored out of the SmallVector class to reduce code duplication b...

void Initialize(MCContext &Ctx, const TargetMachine &TM) override

This method must be called before any actual lowering is done.

MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override

uint16_t PLTRelativeSpecifier

virtual void emitPersonalityValueImpl(MCStreamer &Streamer, const DataLayout &DL, const MCSymbol *Sym, const MachineModuleInfo *MMI) const

MCSection * getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override

Targets should implement this method to assign a section to globals with an explicit section specfied...

const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const override

The mach-o version of this method defaults to returning a stub reference.

bool SupportGOTPCRelWithOffset

Mangler & getMangler() const

bool SupportIndirectSymViaGOTPCRel

bool SupportDebugThreadLocalLocation

Primary interface to the complete machine description for the target machine.

const STC & getSubtarget(const Function &F) const

This method returns a pointer to the specified type of TargetSubtargetInfo.

Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...

Calculates the starting offsets for various sections within the .debug_names section.

This is an optimization pass for GlobalISel generic memory operations.

decltype(auto) dyn_cast(const From &Val)

dyn_cast - Return the argument parameter cast to the specified type.

LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key

static StringRef AArch64PACKeyIDToString(AArch64PACKey::ID KeyID)

Return 2-letter identifier string for numeric key ID.