[llvm] [BOLT] Add --pad-funcs-before=func:n (PR #117924)

Maksim Panchenko via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 19:36:15 PST 2024


================
@@ -319,6 +349,36 @@ bool BinaryEmitter::emitFunction(BinaryFunction &Function,
     Streamer.emitCodeAlignment(Function.getAlign(), &*BC.STI);
   }
 
+  if (size_t Padding = opts::padFunctionBefore(Function)) {
+    // Handle padFuncsBefore after the above alignment logic but before
+    // symbol addresses are decided; with the intent that the nops are
+    // not executed and the original alignment logic is preserved.
----------------
maksfb wrote:

I don't quite understand the comment about nops, since we are not using nops for padding.

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


More information about the llvm-commits mailing list