diff options
author | Petr Hosek <phosek@google.com> | 2021-04-20 16:14:02 -0700 |
---|---|---|
committer | Petr Hosek <phosek@google.com> | 2021-04-21 14:41:39 -0700 |
commit | 7a718e16302314352227188fc82f757468a75e0b (patch) | |
tree | 666105d6a63b5a9f092effec60fe62adb5ba44b0 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | 12a25076463d0b04b535d07982d7420971bcea3e (diff) | |
download | llvm-7a718e16302314352227188fc82f757468a75e0b.zip llvm-7a718e16302314352227188fc82f757468a75e0b.tar.gz llvm-7a718e16302314352227188fc82f757468a75e0b.tar.bz2 |
[MC] Use COMDAT for LSDA only if IR comdat type is any
This fixed issue introduced in 16af97393346ad636298605930a8b503a55eb40a
and 796feb61637c407aefcc0d462f24a1cc41f350d8.
Differential Revision: https://reviews.llvm.org/D100909
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 0c8a921..6fed2ee 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -890,9 +890,11 @@ MCSection *TargetLoweringObjectFileELF::getSectionForLSDA( 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 @@ MCSection *TargetLoweringObjectFileELF::getSectionForLSDA( 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); } |