Skip to content

Commit 13b73e5

Browse files
committed
Revert "[BOLT] Remove --allow-stripped option"
This reverts commit ccabbff. Reintroduce allow-stripped as a fallback mechanism after enforcement of HasSymbolsWithFileName was fixed in llvm#92625.
1 parent 282d2ab commit 13b73e5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ cl::opt<std::string>
105105
"output binary via bolt info section"),
106106
cl::cat(BoltCategory));
107107

108+
cl::opt<bool>
109+
AllowStripped("allow-stripped",
110+
cl::desc("allow processing of stripped binaries"),
111+
cl::Hidden,
112+
cl::cat(BoltCategory));
113+
108114
cl::opt<bool> DumpDotAll(
109115
"dump-dot-all",
110116
cl::desc("dump function CFGs to graphviz format after each stage;"
@@ -3206,12 +3212,14 @@ void RewriteInstance::preprocessProfileData() {
32063212
if (Error E = ProfileReader->preprocessProfile(*BC.get()))
32073213
report_error("cannot pre-process profile", std::move(E));
32083214

3209-
if (!BC->hasSymbolsWithFileName() && ProfileReader->hasLocalsWithFileName()) {
3215+
if (!BC->hasSymbolsWithFileName() && ProfileReader->hasLocalsWithFileName() &&
3216+
!opts::AllowStripped) {
32103217
BC->errs()
32113218
<< "BOLT-ERROR: input binary does not have local file symbols "
32123219
"but profile data includes function names with embedded file "
32133220
"names. It appears that the input binary was stripped while a "
3214-
"profiled binary was not\n";
3221+
"profiled binary was not. If you know what you are doing and "
3222+
"wish to proceed, use -allow-stripped option.\n";
32153223
exit(1);
32163224
}
32173225
}

0 commit comments

Comments
 (0)