Throw an error in instrument for dynamic libs

Summary:
In InstrumentatonRuntimeLibrary, throw an error

if the program uses dynamic libraries

(cherry picked from FBD29265147)
This commit is contained in:
Joey Thaman 2021-06-21 07:45:52 -07:00 committed by Maksim Panchenko
parent bbbd159ccb
commit be0da0fac2

View File

@ -65,6 +65,11 @@ void InstrumentationRuntimeLibrary::adjustCommandLineOptions(
"DT_FINI to write the profile\n";
exit(1);
}
if (!BC.HasFixedLoadAddress) {
outs() << "BOLT-ERROR: shared object or position-independent executables "
"are not allowed in instrumentation mode\n";
exit(1);
}
}
void InstrumentationRuntimeLibrary::emitBinary(BinaryContext &BC,