Files
clang-p2996/bolt/lib/Core/CMakeLists.txt
Maksim Panchenko e290133c76 [BOLT] Add new class for symbolizing X86 instructions
Summary:
While disassembling instructions, we need to replace certain immediate
operands with symbols. This symbolizing process relies on reading
relocations against instructions. However, some X86 instructions can
have multiple immediate operands and up to two relocations against
them. Thus, correctly matching a relocation to an operand is not
always possible without knowing the operand offset within the
instruction.

Luckily, LLVM provides an interface for passing the required info from
the disassembler via a virtual MCSymbolizer class. Creating a
target-specific version allows a precise matching of relocations to
operands.

This diff adds X86MCSymbolizer class that performs X86-specific
symbolizing (currently limited to non-branch instructions).

Reviewers: yota9, Amir, ayermolo, rafauler, zr33

Differential Revision: https://reviews.llvm.org/D120928
2022-05-31 17:48:19 -07:00

34 lines
509 B
CMake

set(LLVM_LINK_COMPONENTS
DebugInfoDWARF
Demangle
MC
MCDisassembler
Object
Support
)
add_llvm_library(LLVMBOLTCore
BinaryBasicBlock.cpp
BinaryContext.cpp
BinaryData.cpp
BinaryEmitter.cpp
BinaryFunction.cpp
BinaryFunctionProfile.cpp
BinarySection.cpp
DebugData.cpp
DynoStats.cpp
Exceptions.cpp
JumpTable.cpp
MCPlusBuilder.cpp
ParallelUtilities.cpp
Relocation.cpp
LINK_LIBS
${LLVM_PTHREAD_LIB}
)
target_link_libraries(LLVMBOLTCore
PRIVATE
LLVMBOLTUtils
)