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
This commit is contained in:
Rui Ueyama 2017-07-20 21:42:30 +00:00
parent 7d50c389c4
commit bc2c9e0278
1 changed files with 3 additions and 4 deletions

View File

@ -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;