[lld] ELF: Introduce --shuffle-padding option. (PR #117653)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 4 18:13:00 PST 2024
================
@@ -1444,6 +1444,38 @@ static void finalizeSynthetic(Ctx &ctx, SyntheticSection *sec) {
}
}
+static bool canInsertPadding(OutputSection *sec) {
+ StringRef s = sec->name;
+ return s == ".bss" || s == ".data" || s == ".data.rel.ro" || s == ".rodata" ||
----------------
pcc wrote:
To me this doesn't feel too different from the hardcoded output section name prefixes in `LinkerScript::getOutputSectionName`. I think it's important for this feature to be user friendly in the common case where there is no linker script or the linker script isn't doing anything unusual. In a future extension, we may consider adding support for custom section patterns like with `--shuffle-sections`. After this is implemented, `--shuffle-padding=1` would just become a shorthand way of writing `--shuffle-padding=.text*=1,.bss=1,...` (or whatever syntax we decide on). But this doesn't need to happen in the initial implementation of the feature.
https://github.com/llvm/llvm-project/pull/117653
More information about the llvm-commits
mailing list