diff --git a/bolt/BinaryFunction.cpp b/bolt/BinaryFunction.cpp index 78bab9a4ba2d..5c382da35447 100644 --- a/bolt/BinaryFunction.cpp +++ b/bolt/BinaryFunction.cpp @@ -3287,8 +3287,14 @@ void BinaryFunction::emitJumpTables(MCStreamer *Streamer) { ELF::SHF_ALLOC); ColdSection = HotSection; } else { - HotSection = BC.MOFI->getReadOnlySection(); - ColdSection = BC.MOFI->getReadOnlyColdSection(); + if (isSimple()) { + HotSection = BC.MOFI->getReadOnlySection(); + ColdSection = BC.MOFI->getReadOnlyColdSection(); + } else { + HotSection = hasProfile() ? BC.MOFI->getReadOnlySection() + : BC.MOFI->getReadOnlyColdSection(); + ColdSection = HotSection; + } } JT.emit(Streamer, HotSection, ColdSection); }