Diff below works around a crash provoked by the

        /DISCARD/ :
        {
                *(.ARM.exidx)
        }

fragment in the kernel linker script.  It seems this issue is already
fixed upstream in a different way.  But backporting that fix isn't
trivial.

ok?


Index: gnu/llvm/tools/lld/ELF/SyntheticSections.cpp
===================================================================
RCS file: /cvs/src/gnu/llvm/tools/lld/ELF/SyntheticSections.cpp,v
retrieving revision 1.7
diff -u -p -r1.7 SyntheticSections.cpp
--- gnu/llvm/tools/lld/ELF/SyntheticSections.cpp        6 Apr 2018 14:38:28 
-0000       1.7
+++ gnu/llvm/tools/lld/ELF/SyntheticSections.cpp        2 Jun 2018 12:16:06 
-0000
@@ -2571,6 +2571,9 @@ void ARMExidxSentinelSection::writeTo(ui
 // The sentinel has to be removed if there are no other .ARM.exidx entries.
 bool ARMExidxSentinelSection::empty() const {
   OutputSection *OS = getParent();
+  if (!OS)
+    return false;
+
   for (auto *B : OS->SectionCommands)
     if (auto *ISD = dyn_cast<InputSectionDescription>(B))
       for (auto *S : ISD->Sections)

Reply via email to