forked from OSchip/llvm-project
[BOLT] For non-simple functions always update jump tables in-place
Summary: For non-simple function we can miss a reference to a jump table or to an indirect goto table. If we move the jump table, the missed reference will not get updated, and the corresponding indirect jump will end up in the old (wrong) location. Updating the original jump table in-place should take care of the issue. (cherry picked from FBD13849776)
This commit is contained in:
parent
af81c7ff80
commit
365bd1f1c8
|
@ -3757,7 +3757,7 @@ void BinaryFunction::emitJumpTables(MCStreamer *Streamer) {
|
|||
auto &JT = *JTI.second;
|
||||
if (opts::PrintJumpTables)
|
||||
JT.print(outs());
|
||||
if (opts::JumpTables == JTS_BASIC && BC.HasRelocations) {
|
||||
if ((opts::JumpTables == JTS_BASIC || !isSimple()) && BC.HasRelocations) {
|
||||
JT.updateOriginal();
|
||||
} else {
|
||||
MCSection *HotSection, *ColdSection;
|
||||
|
|
Loading…
Reference in New Issue