[lld] r269359 - bra

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 14:47:25 PDT 2016


Author: rafael
Date: Thu May 12 16:47:24 2016
New Revision: 269359

URL: http://llvm.org/viewvc/llvm-project?rev=269359&view=rev
Log:
bra

Modified:
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=269359&r1=269358&r2=269359&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu May 12 16:47:24 2016
@@ -69,7 +69,8 @@ private:
 
   void scanRelocs(InputSection<ELFT> &C);
   void scanRelocs(InputSectionBase<ELFT> &S, const Elf_Shdr &RelSec);
-  RelExpr adjustExpr(SymbolBody &S, bool IsWrite, RelExpr Expr, uint32_t Type);
+  RelExpr adjustExpr(const elf::ObjectFile<ELFT> &File, SymbolBody &S,
+                     bool IsWrite, RelExpr Expr, uint32_t Type);
   void createPhdrs();
   void assignAddresses();
   void assignFileOffsets();
@@ -513,8 +514,11 @@ static RelExpr fromPlt(RelExpr Expr) {
 }
 
 template <class ELFT>
-RelExpr Writer<ELFT>::adjustExpr(SymbolBody &Body, bool IsWrite, RelExpr Expr,
+RelExpr Writer<ELFT>::adjustExpr(const elf::ObjectFile<ELFT> &File,
+                                 SymbolBody &Body, bool IsWrite, RelExpr Expr,
                                  uint32_t Type) {
+  if (Target->needsThunk(Type, File, Body))
+    return R_THUNK;
   bool Preemptible = Body.isPreemptible();
   if (Body.isGnuIFunc())
     Expr = toPlt(Expr);
@@ -614,7 +618,7 @@ void Writer<ELFT>::scanRelocs(InputSecti
       continue;
 
     bool Preemptible = Body.isPreemptible();
-    Expr = adjustExpr(Body, IsWrite, Expr, Type);
+    Expr = adjustExpr(File, Body, IsWrite, Expr, Type);
     if (HasError)
       continue;
 




More information about the llvm-commits mailing list