[PATCH] D100909: [MC] Use COMDAT for LSDA only if IR comdat type is any
Petr Hosek via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 20 16:17:28 PDT 2021
phosek created this revision.
phosek added a reviewer: MaskRay.
Herald added a subscriber: hiraditya.
phosek requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This fixed issue introduced in 16af97393346ad636298605930a8b503a55eb40a <https://reviews.llvm.org/rG16af97393346ad636298605930a8b503a55eb40a>
and 796feb61637c407aefcc0d462f24a1cc41f350d8 <https://reviews.llvm.org/rG796feb61637c407aefcc0d462f24a1cc41f350d8>.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D100909
Files:
llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
Index: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
===================================================================
--- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -890,9 +890,11 @@
unsigned Flags = LSDA->getFlags();
const MCSymbolELF *LinkedToSym = nullptr;
StringRef Group;
+ bool IsComdat = false;
if (const Comdat *C = getELFComdat(&F)) {
Flags |= ELF::SHF_GROUP;
Group = C->getName();
+ IsComdat = C->getSelectionKind() == Comdat::Any;
}
// Use SHF_LINK_ORDER to facilitate --gc-sections if we can use GNU ld>=2.36
// or LLD, which support mixed SHF_LINK_ORDER & non-SHF_LINK_ORDER.
@@ -908,7 +910,7 @@
return getContext().getELFSection(
(TM.getUniqueSectionNames() ? LSDA->getName() + "." + F.getName()
: LSDA->getName()),
- LSDA->getType(), Flags, 0, Group, F.hasComdat(), MCSection::NonUniqueID,
+ LSDA->getType(), Flags, 0, Group, IsComdat, MCSection::NonUniqueID,
LinkedToSym);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100909.339033.patch
Type: text/x-patch
Size: 1062 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210420/e39843e4/attachment.bin>
More information about the llvm-commits
mailing list