]> granicus.if.org Git - llvm/commit
[JITLink] Add support for MachO .alt_entry atoms.
authorLang Hames <lhames@gmail.com>
Tue, 7 May 2019 21:35:14 +0000 (21:35 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 7 May 2019 21:35:14 +0000 (21:35 +0000)
commit7fdae47df16e1007840503c36584a7de728bcc9b
tree865886e873c27bd2bb33ae75cf8d79ba41afd7fb
parentc663ff25de6222a8ff814d286fa16515ad3ac6fc
[JITLink] Add support for MachO .alt_entry atoms.

The MachO .alt_entry directive is applied to a symbol to indicate that it is
locked (in terms of address layout and liveness) to its predecessor atom. I.e.
it is an alternate entry point, at a fixed offset, for the previous atom.

This patch updates MachOAtomGraphBuilder to check for the .alt_entry flag on
symbols and add a corresponding LayoutNext edge to the atom-graph. It also
updates MachOAtomGraphBuilder_x86_64 to generalize handling of the
X86_64_RELOC_SUBTRACTOR relocation: previously either the minuend or
subtrahend of the subtraction had to be the same as the atom being fixed up,
now it is only necessary for the minuend or subtrahend to be locked (via any
chain of alt_entry directives) to the atom being fixed up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360194 91177308-0d34-0410-b5e6-96231b3b80d8
lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp
lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.h
lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
test/ExecutionEngine/JITLink/X86/MachO_x86-64_relocations.s