[lld] ELF: Introduce --shuffle-padding flag. (PR #117653)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 26 05:23:28 PST 2024


https://github.com/smithp35 commented:

Sticking to the code here. I'm coming at this from a world where linker scripts are common. I think it should be possible to deal with the additional address requirements by disabling the padding in these cases.

A possible alternative that wouldn't involve a ShufflePadding section is to randomly double the section alignment. For a target like AArch64 where the most common alignment will be 4 and section size is a multiple of 4, then this will roughly approximate adding padding sections, albeit with half the sections already on an 8-byte boundary so it may need a higher probability to balance. I think some CPU targets overalign functions to cache-line boundaries at higher optimisation levels so there's less of an impact.  

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


More information about the llvm-commits mailing list