From: Stefan Gränitz Date: Fri, 31 Mar 2023 07:56:23 +0000 (+0200) Subject: [Orc] Skip sections with duplicate names in DebugObjectManagerPlugin X-Git-Tag: upstream/17.0.6~13099 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=47302af71d57814469a3596c78381fc720ed130d;p=platform%2Fupstream%2Fllvm.git [Orc] Skip sections with duplicate names in DebugObjectManagerPlugin Compiler-generated section names can clash. Examples are group sections or profile counter sections. We don't need to abort debug registration for the entire LinkGraph in such a case. Instead, let's skip the relevant sections and add a note to the debug log. --- diff --git a/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp b/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp index 75d3344..922c60bb 100644 --- a/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp +++ b/llvm/lib/ExecutionEngine/Orc/DebugObjectManagerPlugin.cpp @@ -372,11 +372,12 @@ Error ELFDebugObject::recordSection( if (Error Err = Section->validateInBounds(this->getBuffer(), Name.data())) return Err; auto ItInserted = Sections.try_emplace(Name, std::move(Section)); - if (!ItInserted.second) - return make_error("In " + Buffer->getBufferIdentifier() + - ", encountered duplicate section \"" + - Name + "\" while building debug object", - inconvertibleErrorCode()); + LLVM_DEBUG({ + if (!ItInserted.second) + dbgs() << "Skipping debug registration for section '" << Name << "' " + << "in object " << Buffer->getBufferIdentifier() + << " (duplicate name)\n"; + }); return Error::success(); }