summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Target.h
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/Target.h')
-rw-r--r--lld/ELF/Target.h40
1 files changed, 7 insertions, 33 deletions
diff --git a/lld/ELF/Target.h b/lld/ELF/Target.h
index 1d1f8e531e7..0ffaddc36f0 100644
--- a/lld/ELF/Target.h
+++ b/lld/ELF/Target.h
@@ -24,16 +24,11 @@ public:
uint64_t getVAStart() const { return VAStart; }
unsigned getPCRelReloc() const { return PCRelReloc; }
unsigned getGotReloc() const { return GotReloc; }
- unsigned getPltReloc() const { return PltReloc; }
unsigned getGotRefReloc() const { return GotRefReloc; }
unsigned getRelativeReloc() const { return RelativeReloc; }
- unsigned getPltZeroEntrySize() const { return PltZeroEntrySize; }
unsigned getPltEntrySize() const { return PltEntrySize; }
- virtual void writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const = 0;
- virtual void writePltZeroEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr) const = 0;
virtual void writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr, int32_t Index) const = 0;
+ uint64_t PltEntryAddr) const = 0;
virtual bool isRelRelative(uint32_t Type) const;
virtual bool relocNeedsGot(uint32_t Type, const SymbolBody &S) const = 0;
virtual bool relocPointsToGot(uint32_t Type) const;
@@ -50,21 +45,15 @@ protected:
unsigned PCRelReloc;
unsigned GotRefReloc;
unsigned GotReloc;
- unsigned PltReloc;
unsigned RelativeReloc;
unsigned PltEntrySize = 8;
- unsigned PltZeroEntrySize = 16;
- llvm::StringRef DefaultEntry = "_start";
};
class X86TargetInfo final : public TargetInfo {
public:
X86TargetInfo();
- void writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const override;
- void writePltZeroEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr) const override;
void writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr, int32_t Index) const override;
+ uint64_t PltEntryAddr) const override;
bool relocNeedsGot(uint32_t Type, const SymbolBody &S) const override;
bool relocPointsToGot(uint32_t Type) const override;
bool relocNeedsPlt(uint32_t Type, const SymbolBody &S) const override;
@@ -76,11 +65,8 @@ public:
class X86_64TargetInfo final : public TargetInfo {
public:
X86_64TargetInfo();
- void writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const override;
- void writePltZeroEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr) const override;
void writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr, int32_t Index) const override;
+ uint64_t PltEntryAddr) const override;
bool relocNeedsGot(uint32_t Type, const SymbolBody &S) const override;
bool relocNeedsPlt(uint32_t Type, const SymbolBody &S) const override;
void relocateOne(uint8_t *Buf, uint8_t *BufEnd, const void *RelP,
@@ -92,11 +78,8 @@ public:
class PPC64TargetInfo final : public TargetInfo {
public:
PPC64TargetInfo();
- void writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const override;
- void writePltZeroEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr) const override;
void writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr, int32_t Index) const override;
+ uint64_t PltEntryAddr) const override;
bool relocNeedsGot(uint32_t Type, const SymbolBody &S) const override;
bool relocNeedsPlt(uint32_t Type, const SymbolBody &S) const override;
void relocateOne(uint8_t *Buf, uint8_t *BufEnd, const void *RelP,
@@ -108,11 +91,8 @@ public:
class PPCTargetInfo final : public TargetInfo {
public:
PPCTargetInfo();
- void writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const override;
- void writePltZeroEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr) const override;
void writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr, int32_t Index) const override;
+ uint64_t PltEntryAddr) const override;
bool relocNeedsGot(uint32_t Type, const SymbolBody &S) const override;
bool relocNeedsPlt(uint32_t Type, const SymbolBody &S) const override;
void relocateOne(uint8_t *Buf, uint8_t *BufEnd, const void *RelP,
@@ -123,11 +103,8 @@ public:
class AArch64TargetInfo final : public TargetInfo {
public:
AArch64TargetInfo();
- void writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const override;
- void writePltZeroEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr) const override;
void writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr, int32_t Index) const override;
+ uint64_t PltEntryAddr) const override;
bool relocNeedsGot(uint32_t Type, const SymbolBody &S) const override;
bool relocNeedsPlt(uint32_t Type, const SymbolBody &S) const override;
void relocateOne(uint8_t *Buf, uint8_t *BufEnd, const void *RelP,
@@ -138,11 +115,8 @@ public:
class MipsTargetInfo final : public TargetInfo {
public:
MipsTargetInfo();
- void writeGotPltEntry(uint8_t *Buf, uint64_t Plt) const override;
- void writePltZeroEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr) const override;
void writePltEntry(uint8_t *Buf, uint64_t GotEntryAddr,
- uint64_t PltEntryAddr, int32_t Index) const override;
+ uint64_t PltEntryAddr) const override;
bool relocNeedsGot(uint32_t Type, const SymbolBody &S) const override;
bool relocNeedsPlt(uint32_t Type, const SymbolBody &S) const override;
void relocateOne(uint8_t *Buf, uint8_t *BufEnd, const void *RelP,
OpenPOWER on IntegriCloud