[PATCH] D143390: [BOLT] Add writable segment for allocatable sections

Vladislav Khmelevsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 14:52:06 PST 2023


yota9 added inline comments.


================
Comment at: bolt/lib/Rewrite/RewriteInstance.cpp:4044
+
+  // NOTE Currently .eh_frame_hdr appends to the last segment, recalculate
+  // last segments size based on the NextAvailableAddress variable.
----------------
rafauler wrote:
> Is .eh_frame_hdr part of this new writable segment? Shouldn't it go to the read-only segment? Why is eh_frame_hdr being mapped to the last segment?
Because currently eh_frame_hdr is appended to the binary after all bianary sections were already maped.  I think the patch with rewrite option would fix this behaviour, but for now we can go as-is since currently it only affects instrumentation (not really due to RWX), reorder data pass and golang binaries. As rewrite option review would probably take some time I propose to submit this patch and continue with other golang staff in parallel. Rewrite patch would remove most of this patch except for a tests.. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143390



More information about the llvm-commits mailing list