[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
Wed Feb 14 13:25:42 PST 2024


aeubanks wrote:

I have heard that x86-64 `-fno-pic` is measurably slower than `-fpie` in large workloads, e.g. having to read RIP when accessing globals RIP-relatively is measurable, as opposed a constant address. There are valid reasons for `-fno-pic`.

It seems unlikely that having to support different layouts for different architectures will impose any noticeable maintenance burden on lld's section sorting code, it's fairly straightforward.

> "fail to support -no-pie -mcmodel=medium" is an overstatement.

I don't think this is an overstatement, lld is not respecting the fact that large sections should not contribute to 32-bit relocation pressure in `-fno-pic` builds, and this actually causes issues in practice.

But again, I'd rather see the current version of this PR go in rather than not go in.

https://github.com/llvm/llvm-project/pull/81224


More information about the llvm-branch-commits mailing list