[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
Loading
Please sign in to comment