[BOLT] Cover PIC jump table reference in non-strict mode

Summary:
In non-strict relocation mode it was possible to miss a jump table
reference leading to incorrect code.

(cherry picked from FBD21251467)
This commit is contained in:
Maksim Panchenko 2020-04-26 17:51:07 -07:00
parent ac36e17a73
commit b62a1774af
1 changed files with 3 additions and 3 deletions

View File

@ -433,9 +433,9 @@ BinaryContext::handleAddressRef(uint64_t Address, BinaryFunction &BF,
}
}
// In strict relocation mode, we have to catch jump table references outside
// of the basic block containing the indirect jump.
if (opts::StrictMode) {
// With relocations, catch jump table references outside of the basic block
// containing the indirect jump.
if (HasRelocations) {
const auto MemType = analyzeMemoryAt(Address, BF);
if (MemType == MemoryContentsType::POSSIBLE_PIC_JUMP_TABLE && IsPCRel) {
const MCSymbol *Symbol =