Skip to content

Commit

Permalink
Throw an error in instrument for dynamic libs
Browse files Browse the repository at this point in the history
Summary:
In InstrumentatonRuntimeLibrary, throw an error

if the program uses dynamic libraries

(cherry picked from FBD29265147)
  • Loading branch information
jthamanfb authored and maksfb committed Jun 21, 2021
1 parent bbbd159 commit be0da0f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bolt/src/RuntimeLibs/InstrumentationRuntimeLibrary.cpp
Expand Up @@ -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,
Expand Down

0 comments on commit be0da0f

Please sign in to comment.