mirror of
https://github.com/intel/llvm.git
synced 2026-01-16 05:32:28 +08:00
[BOLT] Restrict creation of jump tables
Summary: Heuristic that creates a jump table for every memory access, including those we do not match against a pattern in an indirect jump, is too permissive and has false positives. Guard this logic under strict mode until we figure out a better strategy. (cherry picked from FBD16192205)
This commit is contained in:
committed by
Maksim Panchenko
parent
3cfc76cdbf
commit
8880969ced
@@ -283,7 +283,12 @@ BinaryContext::handleAddressRef(uint64_t Address, BinaryFunction &BF,
|
||||
}
|
||||
|
||||
const auto MemType = analyzeMemoryAt(Address, BF);
|
||||
if (MemType == MemoryContentsType::POSSIBLE_PIC_JUMP_TABLE && IsPCRel) {
|
||||
// FIXME: this is too permissive in creating jump tables. This is a random
|
||||
// memory access we did not necessarily match against an indirect jump. Only
|
||||
// do this for strict mode, for now. We should revisit this and come up with a
|
||||
// better heuristic.
|
||||
if (opts::StrictMode &&
|
||||
MemType == MemoryContentsType::POSSIBLE_PIC_JUMP_TABLE && IsPCRel) {
|
||||
JumpTable *JT;
|
||||
const MCSymbol *Symbol;
|
||||
std::tie(JT, Symbol) =
|
||||
|
||||
Reference in New Issue
Block a user