[llvm-branch-commits] [ELF] Place .lbss/.lrodata/.ldata after .bss (PR #81224)
Arthur Eubanks via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Feb 9 10:19:52 PST 2024
================
@@ -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
More information about the llvm-branch-commits
mailing list