[llvm-branch-commits] [ELF] Place .lbss/.lrodata/.ldata after .bss (PR #81224)

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Feb 12 19:39:07 PST 2024


MaskRay wrote:

> ISTM that making the layout conditional in order to not regress the most-common case (PIE) would be worth a minor amount of code in lld, even though the benefit is also relatively small.
> 
> Do you think INSERT scripts are going to be a real-world issue there? It seems to me like it wouldn't much matter to someone doing INSERT BEFORE/AFTER .lrodata, if lrodata goes near the beginning or near the end?

This has been my objection to making this layout change at all.
If we consider `-no-pie` an uncommon case that has to be supported, ISTM we can require the user to use a linker script fragment

```
SECTIONS { .lrodata : { *(.lrodata .lrodata.*) } } INSERT AFTER .bss;
```

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


More information about the llvm-branch-commits mailing list