diff options
-rw-r--r-- | lld/ELF/InputSection.cpp | 7 | ||||
-rw-r--r-- | lld/test/ELF/merge-string.s | 2 |
2 files changed, 2 insertions, 7 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp index 49dee048cec..e8f24e14109 100644 --- a/lld/ELF/InputSection.cpp +++ b/lld/ELF/InputSection.cpp @@ -76,13 +76,6 @@ InputSectionBase<ELFT>::InputSectionBase(elf::ObjectFile<ELFT> *File, if (V > UINT32_MAX) fatal(toString(File) + ": section sh_addralign is too large"); Alignment = V; - - // If it is not a mergeable section, overwrite the flag so that the flag - // is consistent with the class. This inconsistency could occur when - // string merging is disabled using -O0 flag. - if (!Config->Relocatable && !isa<MergeInputSection<ELFT>>(this) && - !isa<SyntheticSection<ELFT>>(this)) - this->Flags &= ~(SHF_MERGE | SHF_STRINGS); } template <class ELFT> diff --git a/lld/test/ELF/merge-string.s b/lld/test/ELF/merge-string.s index 9e59a9cd29e..e884f97619a 100644 --- a/lld/test/ELF/merge-string.s +++ b/lld/test/ELF/merge-string.s @@ -61,6 +61,8 @@ zed: // NOMERGE-NEXT: Type: SHT_PROGBITS // NOMERGE-NEXT: Flags [ // NOMERGE-NEXT: SHF_ALLOC +// NOMERGE-NEXT: SHF_MERGE +// NOMERGE-NEXT: SHF_STRINGS // NOMERGE-NEXT: ] // NOMERGE-NEXT: Address: 0x1C8 // NOMERGE-NEXT: Offset: 0x1C8 |