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

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 28 13:03:56 PDT 2023


maksfb accepted this revision.
maksfb added a comment.
This revision is now accepted and ready to land.

LGTM. I think it's fine to omit the test case as an exception.



================
Comment at: bolt/lib/Rewrite/ExecutableFileMemoryManager.cpp:33-34
+  // causing non-deterministic output section contents.
+  if (Size == 1)
+    *Ret = 0;
+
----------------
jobnoorman wrote:
> 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`.
True.


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