diff --git a/bolt/src/BinaryFunction.cpp b/bolt/src/BinaryFunction.cpp index 4dfc930c2df0..10e1e65a29d6 100644 --- a/bolt/src/BinaryFunction.cpp +++ b/bolt/src/BinaryFunction.cpp @@ -1407,7 +1407,7 @@ void BinaryFunction::postProcessJumpTables() { if (JT.Type == JumpTable::JTT_PIC && opts::JumpTables == JTS_BASIC) { opts::JumpTables = JTS_MOVE; outs() << "BOLT-INFO: forcing -jump-tables=move as PIC jump table was " - "detected\n"; + "detected in function " << *this << '\n'; } for (unsigned I = 0; I < JT.OffsetEntries.size(); ++I) { auto Offset = JT.OffsetEntries[I]; diff --git a/bolt/src/RewriteInstance.cpp b/bolt/src/RewriteInstance.cpp index 158949abf43d..990c7c6ee1b9 100644 --- a/bolt/src/RewriteInstance.cpp +++ b/bolt/src/RewriteInstance.cpp @@ -804,6 +804,11 @@ void RewriteInstance::discoverStorage() { exit(1); } auto Obj = ELF64LEFile->getELFFile(); + if (Obj->getHeader()->e_type != ELF::ET_EXEC) { + errs() << "BOLT-ERROR: only non-PIE ELF executables are supported at the " + "moment.\n"; + exit(1); + } EntryPoint = Obj->getHeader()->e_entry;