[PATCH] D33628: [ELF] Filter out non InputSection members from InputSections

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 28 01:25:57 PDT 2017


phosek created this revision.
phosek added a project: lld.
Herald added a subscriber: emaste.

InputSections may contain MergeInputSection members which trigger a segmentation fault when trying to cast them to InputSection.


Repository:
  rL LLVM

https://reviews.llvm.org/D33628

Files:
  ELF/LinkerScript.cpp


Index: ELF/LinkerScript.cpp
===================================================================
--- ELF/LinkerScript.cpp
+++ ELF/LinkerScript.cpp
@@ -290,6 +290,9 @@
     size_t SizeBefore = Ret.size();
 
     for (InputSectionBase *Sec : InputSections) {
+      if (!isa<InputSection>(Sec))
+        continue;
+
       if (Sec->Assigned)
         continue;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33628.100545.patch
Type: text/x-patch
Size: 360 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170528/c42d9375/attachment.bin>


More information about the llvm-commits mailing list