[PATCH] D55943: [RuntimeDyld] load all sections with ProcessAllSections

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 15 16:44:34 PST 2019


yonghong-song updated this revision to Diff 181932.
yonghong-song retitled this revision from "[RuntimeDyld] load all non-relocation sections with ProcessAllSections" to "[RuntimeDyld] load all sections with ProcessAllSections".
yonghong-song edited the summary of this revision.
yonghong-song added a comment.

address Lang's comments. Emit all not-yet-loaded sections.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55943/new/

https://reviews.llvm.org/D55943

Files:
  lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp


Index: lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
===================================================================
--- lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -382,6 +382,25 @@
       Checker->registerStubMap(Obj.getFileName(), SectionID, Stubs);
   }
 
+  // Process remaining sections
+  if (ProcessAllSections) {
+    LLVM_DEBUG(dbgs() << "Process remaining sections:\n");
+    for (section_iterator SI = Obj.section_begin(), SE = Obj.section_end();
+         SI != SE; ++SI) {
+
+      /* Ignore already loaded sections */
+      if (LocalSections.find(*SI) != LocalSections.end())
+        continue;
+
+      bool IsCode = SI->isText();
+      if (auto SectionIDOrErr =
+              findOrEmitSection(Obj, *SI, IsCode, LocalSections))
+        LLVM_DEBUG(dbgs() << "\tSectionID: " << (*SectionIDOrErr) << "\n");
+      else
+        return SectionIDOrErr.takeError();
+    }
+  }
+
   // Give the subclasses a chance to tie-up any loose ends.
   if (auto Err = finalizeLoad(Obj, LocalSections))
     return std::move(Err);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55943.181932.patch
Type: text/x-patch
Size: 1101 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190116/6d0ce2d8/attachment.bin>


More information about the llvm-commits mailing list