summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-12-11 22:40:18 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-12-11 22:40:18 +0000
commit9c8d7f8dccd88044458121748dbad5d2f875030f (patch)
treed8a41c5062efff6432327b705dd5185dedb4e4db
parentefef032f02b4817d852acf1203367480613e5123 (diff)
downloadbcm5719-llvm-9c8d7f8dccd88044458121748dbad5d2f875030f.tar.gz
bcm5719-llvm-9c8d7f8dccd88044458121748dbad5d2f875030f.zip
Return R_PLT_PC for R_PPC_PLTREL24.
The PPC port doesn't support PLT yet, but the architecture independent code optimizes PLT access for non preemptible symbols, which is exactly what returning R_PC was trying to implement. llvm-svn: 320430
-rw-r--r--lld/ELF/Arch/PPC.cpp9
1 files changed, 1 insertions, 8 deletions
diff --git a/lld/ELF/Arch/PPC.cpp b/lld/ELF/Arch/PPC.cpp
index e23bcfcfc7a..6af0df331df 100644
--- a/lld/ELF/Arch/PPC.cpp
+++ b/lld/ELF/Arch/PPC.cpp
@@ -34,15 +34,8 @@ RelExpr PPC::getRelExpr(RelType Type, const Symbol &S,
case R_PPC_REL24:
case R_PPC_REL32:
return R_PC;
- // In general case R_PPC_PLTREL24 should result in R_PLT_PC, however, since
- // PLT support is currently not available for PPC32 this workaround at least
- // allows lld to resolve local symbols when performing static linkage after
- // LLVM started to forcibly use PLT relocations by default (see D38554).
- // Non-local symbols will need a full PLT implementation, but once it lands
- // local symbols should still avoid PLT table with static relocation model.
- // This is the optimisation that bfd and gold are doing by default as well.
case R_PPC_PLTREL24:
- return R_PC;
+ return R_PLT_PC;
default:
return R_ABS;
}
OpenPOWER on IntegriCloud