From b26f45e5a49ae363164e7dbbf57eadd9e78d612c Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 25 Oct 2022 18:37:24 -0700 Subject: [PATCH] [ORC] Skip non-SHF_ALLOC sections in DebugObjectManagerPlugin. 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp b/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp index 690f6b2..418dc39 100644 --- a/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp +++ b/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp @@ -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>(&Header); if (Error Err = DebugObj->recordSection(*Name, std::move(Wrapped))) return std::move(Err); -- 2.7.4