================ @@ -988,10 +991,10 @@ static unsigned getSectionRank(OutputSection &osec) { osec.relro = true; else rank |= RF_NOT_RELRO; - // Place .ldata and .lbss after .bss. Making .bss closer to .text alleviates - // relocation overflow pressure. + // Place .lbss/.lrodata/.ldata after .bss. .bss/.lbss being adjacent reuses + // the NOBITS size optimization. if (osec.flags & SHF_X86_64_LARGE && config->emachine == EM_X86_64) - rank |= RF_LARGE; + rank |= osec.type == SHT_NOBITS ? 1 : RF_LARGE; ---------------- MaskRay wrote:
I think we can treat `RF_*` as defining larger regions and integer immediates as a mechanism to pick a subregion within a larger region. The immediate use here is similar to `.interp/SHT_NOTE` and target-specific tunings (`.sdata`, `.got`, etc). https://github.com/llvm/llvm-project/pull/81224 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits