[lld] ELF: Introduce --randomize-section-padding option. (PR #117653)

via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 17:41:51 PST 2024


================
@@ -1444,6 +1444,40 @@ 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 == ".lbss" ||
+         s == ".ldata" || s == ".lrodata" || s == ".ltext" || s == ".rodata" ||
----------------
pcc wrote:

`s/just .ltext/remove .ltext/` ? I got the impression from https://github.com/llvm/llvm-project/blob/768754807f17754fb450ec672779b827ad5df4b4/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp#L619 and https://github.com/llvm/llvm-project/blob/768754807f17754fb450ec672779b827ad5df4b4/llvm/lib/Target/TargetMachine.cpp#L73 that it was, or am I missing something?

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


More information about the llvm-commits mailing list