From bc2c9e0278c1056f20aec90930692ee52d30d03c Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 20 Jul 2017 21:42:30 +0000 Subject: [PATCH] Do not strip SHF_GROUP in elf::decompressAndMergeSections(). SHF_GROUP flag should have been removed when the control reaches here because InputSectionBase turns the flag off. So this code should be redundant. llvm-svn: 308680 --- lld/ELF/SyntheticSections.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index c0e6deab7849..7540f22a42ce 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2239,16 +2239,15 @@ void elf::decompressAndMergeSections() { continue; StringRef OutsecName = getOutputSectionName(MS->Name); - uint64_t Flags = MS->Flags & ~(uint64_t)SHF_GROUP; uint32_t Alignment = std::max(MS->Alignment, MS->Entsize); auto I = llvm::find_if(MergeSections, [=](MergeSyntheticSection *Sec) { - return Sec->Name == OutsecName && Sec->Flags == Flags && + return Sec->Name == OutsecName && Sec->Flags == MS->Flags && Sec->Alignment == Alignment; }); if (I == MergeSections.end()) { - MergeSyntheticSection *Syn = - make(OutsecName, MS->Type, Flags, Alignment); + MergeSyntheticSection *Syn = make( + OutsecName, MS->Type, MS->Flags, Alignment); MergeSections.push_back(Syn); I = std::prev(MergeSections.end()); S = Syn;