mirror of
https://github.com/intel/llvm.git
synced 2026-01-27 06:06:34 +08:00
Delete needsDynRelative.
It is now redundant. Writer.cpp can reason that 2 dynamic relocations are needed: one to find the final got entry address and one to fill the got entry. llvm-svn: 266876
This commit is contained in:
@@ -84,7 +84,6 @@ public:
|
||||
int32_t Index, unsigned RelOff) const override;
|
||||
bool isRelRelative(uint32_t Type) const override;
|
||||
bool needsCopyRelImpl(uint32_t Type) const override;
|
||||
bool needsDynRelative(uint32_t Type) const override;
|
||||
bool needsPltImpl(uint32_t Type) const override;
|
||||
void relocateOne(uint8_t *Loc, uint32_t Type, uint64_t Val) const override;
|
||||
|
||||
@@ -510,10 +509,6 @@ void X86TargetInfo::relocateOne(uint8_t *Loc, uint32_t Type,
|
||||
write32le(Loc, Val);
|
||||
}
|
||||
|
||||
bool X86TargetInfo::needsDynRelative(uint32_t Type) const {
|
||||
return Config->Shared && Type == R_386_TLS_IE;
|
||||
}
|
||||
|
||||
void X86TargetInfo::relaxTlsGdToLe(uint8_t *Loc, uint32_t Type,
|
||||
uint64_t Val) const {
|
||||
// GD can be optimized to LE:
|
||||
@@ -1166,6 +1161,7 @@ bool AArch64TargetInfo::isRelRelative(uint32_t Type) const {
|
||||
case R_AARCH64_TLSLE_ADD_TPREL_HI12:
|
||||
case R_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
|
||||
case R_AARCH64_TSTBR14:
|
||||
case R_AARCH64_LD64_GOT_LO12_NC:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,6 @@ public:
|
||||
// dynamic linker if isRelRelative returns true.
|
||||
virtual bool isRelRelative(uint32_t Type) const;
|
||||
|
||||
virtual bool needsDynRelative(uint32_t Type) const { return false; }
|
||||
virtual bool refersToGotEntry(uint32_t Type) const;
|
||||
|
||||
enum PltNeed { Plt_No, Plt_Explicit, Plt_Implicit };
|
||||
|
||||
@@ -501,7 +501,7 @@ void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Target->needsDynRelative(Type))
|
||||
if (Expr == R_GOT && !Target->isRelRelative(Type) && Config->Shared)
|
||||
AddDyn({Target->RelativeRel, C.OutSec, Offset, true, &Body,
|
||||
getAddend<ELFT>(RI)});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user