[PATCH] D97898: [RuntimeDyld] Add allowStubs/allowZeroSyms

Rafael Auler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 3 17:46:00 PST 2021


rafauler created this revision.
rafauler added a reviewer: lhames.
Herald added a subscriber: hiraditya.
rafauler requested review of this revision.
Herald added a project: LLVM.

This patch introduces functionality used by BOLT when
re-linking the final binary. It adds to MemoryManager a new member
function allowStubAllocation to control whether this MemoryManager
supports increasing code size with stubs or not. Since BOLT can
rewrite some files in-place, it needs to avoid stub insertion done
by the linker. This patch also introduces allowsZeroSymbols to the
JITSymbolResolver class, enabling us to finish a link successfully
even when some symbols resolve to the value zero. When rewriting a
binary, sometimes we do need to resolve a target to zero in case
the input binary calls address zero and we want to be bug
compatible. We also expose reassignSectionAddress as it is used by
BOLT.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97898

Files:
  llvm/include/llvm/ExecutionEngine/JITSymbol.h
  llvm/include/llvm/ExecutionEngine/RuntimeDyld.h
  llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
  llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97898.327973.patch
Type: text/x-patch
Size: 4729 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210304/ad932dc1/attachment.bin>


More information about the llvm-commits mailing list