summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-04-21 16:59:25 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-04-21 16:59:25 +0000
commit34b335bdf7bdcd4e7dec8d3915a704fed6adcd62 (patch)
tree2e3a8d11815ac535d7edc8a5228265d46249a2f5
parenta5ba99140c7865793a0e1154f9a7bb9a2f791851 (diff)
downloadbcm5719-llvm-34b335bdf7bdcd4e7dec8d3915a704fed6adcd62.tar.gz
bcm5719-llvm-34b335bdf7bdcd4e7dec8d3915a704fed6adcd62.zip
Don't recompute getRelExpr. NFC.
llvm-svn: 267005
-rw-r--r--lld/ELF/Writer.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index a227cb86923..322e1b17a0d 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -435,7 +435,7 @@ namespace {
enum PltNeed { Plt_No, Plt_Explicit, Plt_Implicit };
}
-static PltNeed needsPlt(uint32_t Type, const SymbolBody &S) {
+static PltNeed needsPlt(RelExpr Expr, uint32_t Type, const SymbolBody &S) {
if (S.isGnuIFunc())
return Plt_Explicit;
if (S.isPreemptible() && Target->needsPlt(Type))
@@ -462,11 +462,9 @@ static PltNeed needsPlt(uint32_t Type, const SymbolBody &S) {
// that points to the real function is a dedicated got entry used by the
// plt. That is identified by special relocation types (R_X86_64_JUMP_SLOT,
// R_386_JMP_SLOT, etc).
- if (S.isShared() && !Config->Pic && S.isFunc()) {
- RelExpr Expr = Target->getRelExpr(Type, S);
+ if (S.isShared() && !Config->Pic && S.isFunc())
if (!refersToGotEntry(Expr))
return Plt_Implicit;
- }
return Plt_No;
}
@@ -568,7 +566,7 @@ void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) {
// If a relocation needs PLT, we create a PLT and a GOT slot
// for the symbol.
- PltNeed NeedPlt = needsPlt(Type, Body);
+ PltNeed NeedPlt = needsPlt(Expr, Type, Body);
if (NeedPlt) {
if (NeedPlt == Plt_Implicit)
Body.NeedsCopyOrPltAddr = true;
OpenPOWER on IntegriCloud