Index: ELF/OutputSections.cpp =================================================================== --- ELF/OutputSections.cpp +++ ELF/OutputSections.cpp @@ -538,7 +538,7 @@ static SectionKey createKey(InputSectionBase *C, StringRef OutsecName) { typedef typename ELFT::uint uintX_t; - uintX_t Flags = getOutFlags(C); + uintX_t Flags = getOutFlags(C) & ~SHF_WRITE; // For SHF_MERGE we create different output sections for each alignment. // This makes each output section simple and keeps a single level mapping from