[PATCH] D149243: [BOLT] Make sure all section allocations have deterministic contents

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 11:23:23 PDT 2023


maksfb added inline comments.


================
Comment at: bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp:33-34
+  // causing non-deterministic output section contents.
+  if (Size == 1)
+    *Ret = 0;
+
----------------
Could lead to surprising results if someone decides to allocate a section with one byte for whatever reason. I can't think of a much better alternative though, but let's add an assertion that we don't create a one-byte section.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149243/new/

https://reviews.llvm.org/D149243



More information about the llvm-commits mailing list