[ORC] Skip non-SHF_ALLOC sections in DebugObjectManagerPlugin.
authorLang Hames <lhames@gmail.com>
Wed, 26 Oct 2022 01:37:24 +0000 (18:37 -0700)
committerLang Hames <lhames@gmail.com>
Wed, 26 Oct 2022 01:40:38 +0000 (18:40 -0700)
We don't need to provide a load-address for non-alloc sections. Skipping them
allows us to avoid some complications, like handling duplicate .group sections.

llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp

index 690f6b2..418dc39 100644 (file)
@@ -289,6 +289,9 @@ ELFDebugObject::CreateArchType(MemoryBufferRef Buffer,
       continue;
     HasDwarfSection |= isDwarfSection(*Name);
 
+    if (!(Header.sh_flags & ELF::SHF_ALLOC))
+      continue;
+
     auto Wrapped = std::make_unique<ELFDebugObjectSection<ELFT>>(&Header);
     if (Error Err = DebugObj->recordSection(*Name, std::move(Wrapped)))
       return std::move(Err);