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

James Y Knight via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 13 08:17:47 PST 2024


jyknight wrote:

> I don't think this means that we unsupport -no-pie use cases

Yes, we'd still support -no-pie, but we'd fail to support -no-pie -mcmodel=medium.

> cost of layout purity

I see that you feel strongly about this (e.g. by calling it "purity"), but I don't understand why. It's not the cost of the "if" in the implementation you're worried about, I think, but some other aspect?

> INSERT AFTER .lrodata would give different behaviors (a 32-bit offset relative to .text is positive in one while negative in the other)

I agree that the sign of the relative offset will change...but why is that concerning? The whole point of "INSERT AFTER" is to avoid specifying the entire layout. Does it matter that the offset relative to .text is sometimes negative and sometimes positive?

> which we should not treat hand-wavy.

Have scripts been broken by the _unconditional_ change from the offset being always-negative to the offset being always-positive? It seems unlikely to me that they would be, but am I missing something? If they don't, then that seems like having it be conditional is also fine.

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


More information about the llvm-branch-commits mailing list