[lld] r308680 - Do not strip SHF_GROUP in elf::decompressAndMergeSections().

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 20 14:42:30 PDT 2017


Author: ruiu
Date: Thu Jul 20 14:42:30 2017
New Revision: 308680

URL: http://llvm.org/viewvc/llvm-project?rev=308680&view=rev
Log:
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.

Modified:
    lld/trunk/ELF/SyntheticSections.cpp

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=308680&r1=308679&r2=308680&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Thu Jul 20 14:42:30 2017
@@ -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<uint32_t>(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<MergeSyntheticSection>(OutsecName, MS->Type, Flags, Alignment);
+      MergeSyntheticSection *Syn = make<MergeSyntheticSection>(
+          OutsecName, MS->Type, MS->Flags, Alignment);
       MergeSections.push_back(Syn);
       I = std::prev(MergeSections.end());
       S = Syn;




More information about the llvm-commits mailing list