[PATCH] D18719: setUsedInRegulawrObj and MustBeInDynSym fixes

Peter Collingbourne via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 17:10:43 PDT 2016


pcc created this revision.
pcc added reviewers: davide, rafael.
pcc added a subscriber: llvm-commits.

WIP.

http://reviews.llvm.org/D18719

Files:
  ELF/SymbolTable.cpp
  ELF/Symbols.cpp

Index: ELF/Symbols.cpp
===================================================================
--- ELF/Symbols.cpp
+++ ELF/Symbols.cpp
@@ -185,7 +185,7 @@
   // and in DSOs, so that the symbols in the executable can interrupt
   // symbols in the DSO at runtime.
   if (isShared() != Other->isShared())
-    if (isa<DefinedRegular<ELFT>>(isShared() ? Other : this))
+    if (isa<Defined>(isShared() ? Other : this))
       MustBeInDynSym = Other->MustBeInDynSym = true;
 
   if (L != R)
Index: ELF/SymbolTable.cpp
===================================================================
--- ELF/SymbolTable.cpp
+++ ELF/SymbolTable.cpp
@@ -99,6 +99,9 @@
 
   // Compile bitcode files.
   Lto.reset(new BitcodeCompiler);
+  for (auto &F : ObjectFiles)
+    for (auto S : F->getSymbols())
+      S->repl().setUsedInRegularObj();
   for (const std::unique_ptr<BitcodeFile> &F : BitcodeFiles)
     Lto->add(*F);
   std::unique_ptr<InputFile> IF = Lto->compile();
@@ -112,6 +115,8 @@
     Sym->Body->setUsedInRegularObj();
     if (!Sym->Body->isUndefined() && Body->isUndefined())
       continue;
+    if (Sym->Body->MustBeInDynSym)
+      Body->MustBeInDynSym = true;
     Sym->Body = Body;
   }
   ObjectFiles.emplace_back(Obj);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D18719.52449.patch
Type: text/x-patch
Size: 1218 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160402/b4ff4a26/attachment.bin>


More information about the llvm-commits mailing list