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

Job Noorman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 23:47:47 PDT 2023


jobnoorman added inline comments.


================
Comment at: bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp:33-34
+  // causing non-deterministic output section contents.
+  if (Size == 1)
+    *Ret = 0;
+
----------------
maksfb wrote:
> 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.
I don't think this should be a problem as in that case, the section contents will later be overwritten by `RuntimeDyld`.


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