================ @@ -733,16 +733,22 @@ calcUniqueIDUpdateFlagsAndSize(const GlobalObject *GO, StringRef SectionName, Ctx.isELFGenericMergeableSection(SectionName); // If this is the first ocurrence of this section name, treat it as the // generic section - if (!SymbolMergeable && !SeenSectionNameBefore) - return MCContext::GenericSectionID; + if (!SymbolMergeable && !SeenSectionNameBefore) { + if (TM.getSeparateNamedSections()) + return NextUniqueID++; + else + return MCContext::GenericSectionID; + } // Symbols must be placed into sections with compatible entry sizes. Generate // unique sections for symbols that have not been assigned to compatible // sections. const auto PreviousID = Ctx.getELFUniqueIDForEntsize(SectionName, Flags, EntrySize); - if (PreviousID) + if (PreviousID && (!TM.getSeparateNamedSections() || + *PreviousID == MCContext::GenericSectionID)) { return *PreviousID; ---------------- MaskRay wrote:
drop braces for one-line single statement https://github.com/llvm/llvm-project/pull/91028 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits