[all-commits] [llvm/llvm-project] 43f56a: [BOLT] Fix handling of code references from unmodi...
maksfb via All-commits
all-commits at lists.llvm.org
Mon Jun 12 10:47:12 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 43f56a2f27e565af6983b86e748e49935675e9db
https://github.com/llvm/llvm-project/commit/43f56a2f27e565af6983b86e748e49935675e9db
Author: Maksim Panchenko <maks at fb.com>
Date: 2023-06-12 (Mon, 12 Jun 2023)
Changed paths:
M bolt/include/bolt/Core/BinaryFunction.h
M bolt/include/bolt/Core/MCPlusBuilder.h
M bolt/lib/Core/BinaryFunction.cpp
M bolt/lib/Target/X86/X86MCPlusBuilder.cpp
M bolt/lib/Target/X86/X86MCSymbolizer.cpp
M bolt/lib/Target/X86/X86MCSymbolizer.h
A bolt/test/X86/double-rel-scan.s
M bolt/test/X86/double-rel.s
M bolt/test/X86/gotpcrelx.s
Log Message:
-----------
[BOLT] Fix handling of code references from unmodified code
In lite mode (default for X86), BOLT optimizes and relocates functions
with profile. The rest of the code is preserved, but if it references
relocated code such references have to be updated. The update is handled
by scanExternalRefs() function. Note that we cannot solely rely on
relocations written by the linker, as not all code references are
exposed to the linker. Additionally, the linker can modify certain
instructions and relocations will no longer match the code.
With this change, start using symbolic disassembler for scanning code
for references in scanExternalRefs(). Unlike the previous approach, the
symbolizer properly detects and creates references for instructions with
multiple/ambiguous symbolic operands and handles cases where a
relocation doesn't match any operand. See test cases for examples.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D152631
More information about the All-commits
mailing list