================
@@ -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;
----------------
aeubanks wrote:

the `1` should have a `RF_*` name to better express intent

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

Reply via email to