]> granicus.if.org Git - llvm/commit
[JITLink] Switch from an atom-based model to a "blocks and symbols" model.
authorLang Hames <lhames@gmail.com>
Fri, 4 Oct 2019 03:55:26 +0000 (03:55 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 4 Oct 2019 03:55:26 +0000 (03:55 +0000)
commit21ddb432f74c0484115a0423c6031af36bf22d70
tree6c4cf8418de3775418b2c5c16eab83d1dff14851
parent515eefeb33f90d4528bfca03a0392ee6701630cd
[JITLink] Switch from an atom-based model to a "blocks and symbols" model.

In the Atom model the symbols, content and relocations of a relocatable object
file are represented as a graph of atoms, where each Atom represents a
contiguous block of content with a single name (or no name at all if the
content is anonymous), and where edges between Atoms represent relocations.
If more than one symbol is associated with a contiguous block of content then
the content is broken into multiple atoms and layout constraints (represented by
edges) are introduced to ensure that the content remains effectively contiguous.
These layout constraints must be kept in mind when examining the content
associated with a symbol (it may be spread over multiple atoms) or when applying
certain relocation types (e.g. MachO subtractors).

This patch replaces the Atom model in JITLink with a blocks-and-symbols model.
The blocks-and-symbols model represents relocatable object files as bipartite
graphs, with one set of nodes representing contiguous content (Blocks) and
another representing named or anonymous locations (Symbols) within a Block.
Relocations are represented as edges from Blocks to Symbols. This scheme
removes layout constraints (simplifying handling of MachO alt-entry symbols,
and hopefully ELF sections at some point in the future) and simplifies some
relocation logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373689 91177308-0d34-0410-b5e6-96231b3b80d8
25 files changed:
include/llvm/ExecutionEngine/JITLink/EHFrameSupport.h
include/llvm/ExecutionEngine/JITLink/JITLink.h
include/llvm/ExecutionEngine/JITLink/JITLinkMemoryManager.h
lib/ExecutionEngine/JITLink/BasicGOTAndStubsBuilder.h
lib/ExecutionEngine/JITLink/CMakeLists.txt
lib/ExecutionEngine/JITLink/EHFrameSupport.cpp
lib/ExecutionEngine/JITLink/EHFrameSupportImpl.h
lib/ExecutionEngine/JITLink/JITLink.cpp
lib/ExecutionEngine/JITLink/JITLinkGeneric.cpp
lib/ExecutionEngine/JITLink/JITLinkGeneric.h
lib/ExecutionEngine/JITLink/JITLinkMemoryManager.cpp
lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.cpp [deleted file]
lib/ExecutionEngine/JITLink/MachOAtomGraphBuilder.h [deleted file]
lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.cpp [new file with mode: 0644]
lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h [new file with mode: 0644]
lib/ExecutionEngine/JITLink/MachO_x86_64.cpp
lib/ExecutionEngine/Orc/Core.cpp
lib/ExecutionEngine/Orc/ObjectLinkingLayer.cpp
test/ExecutionEngine/JITLink/X86/MachO_zero_fill_alignment.s
tools/llvm-jitlink/llvm-jitlink-macho.cpp
tools/llvm-jitlink/llvm-jitlink.cpp
tools/llvm-jitlink/llvm-jitlink.h
unittests/ExecutionEngine/JITLink/JITLinkTestCommon.cpp
unittests/ExecutionEngine/JITLink/JITLinkTestCommon.h
unittests/ExecutionEngine/JITLink/MachO_x86_64_Tests.cpp