[PATCH] D147544: [BOLT] Move from RuntimeDyld to JITLink
Job Noorman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 25 04:54:12 PDT 2023
jobnoorman added a comment.
In D147544#4293906 <https://reviews.llvm.org/D147544#4293906>, @maksfb wrote:
> Right. RuntimeDyld will not emit a section without relocations. E.g., for .debug_line, we have to make the section allocatable (https://github.com/llvm/llvm-project/blob/99cfaf0d5ed68d5d4e292fc87a10b1bb26201787/bolt/lib/Core/BinaryEmitter.cpp#L190-L199) and then force a dummy relocation against it (https://github.com/llvm/llvm-project/blob/5f2b0892d5b732a822728f96a57144f6542c155e/bolt/lib/Core/DebugData.cpp#L1631-L1637).
>
> Sounds like with JITLink at least the hack for the relocation is not needed. @lhames, could you please confirm that it's by design?
In `JITLink`, the pruning <https://github.com/llvm/llvm-project/blob/ca94b02e559242e6d1fcdd65320334438be69448/llvm/lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp#L266-L337> of sections is based on symbol liveness. Only sections (blocks actually) that have live symbols pointing to them will be kept for linking. Which symbols are live, is controlled by BOLT. See `markSectionsLive` in `JITLinkLinker.cpp` in this patch.
The hack you are talking about has indeed been removed by this patch.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D147544/new/
https://reviews.llvm.org/D147544
More information about the llvm-commits
mailing list