[PATCH] D26133: [ELF] Allow relative relocations to absolute symbols in PIC

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 6 16:52:53 PST 2017


phosek updated this revision to Diff 87340.

Repository:
  rL LLVM

https://reviews.llvm.org/D26133

Files:
  ELF/Relocations.cpp


Index: ELF/Relocations.cpp
===================================================================
--- ELF/Relocations.cpp
+++ ELF/Relocations.cpp
@@ -351,6 +351,8 @@
   // between start of a function and '_gp' value and defined as absolute just
   // to simplify the code.
   if (AbsVal && RelE) {
+    if (Body.isLocal() || Body.getVisibility() == STV_HIDDEN)
+      return true;
     if (Body.isUndefined() && !Body.isLocal() && Body.symbol()->isWeak())
       return true;
     if (&Body == ElfSym<ELFT>::MipsGpDisp)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26133.87340.patch
Type: text/x-patch
Size: 517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170207/f0e0ef74/attachment.bin>


More information about the llvm-commits mailing list