Skip to content

Commit 8798806

Browse files
Addressing reviewers (2)
1 parent b4e906c commit 8798806

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1689,7 +1689,7 @@ bool BinaryFunction::scanExternalRefs() {
16891689
// Create relocation for every fixup.
16901690
for (const MCFixup &Fixup : Fixups) {
16911691
std::optional<Relocation> Rel = BC.MIB->createRelocation(Fixup, *BC.MAB);
1692-
// Can be skipped under the right circumstances.
1692+
// Can be skipped in case of overlow during relocation value encoding.
16931693
Rel->setOptional();
16941694
if (!Rel) {
16951695
Success = false;

bolt/lib/Core/BinarySection.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,9 @@ void BinarySection::flushPendingRelocations(raw_pwrite_stream &OS,
190190
// relocations are flushed. Otherwise, PatchEntries should run.
191191
if (!opts::ForcePatch) {
192192
BC.errs()
193-
<< "BOLT-ERROR: Cannot fully run scanExternalRefs as pending "
194-
"relocation for symbol "
193+
<< "BOLT-ERROR: Cannot encode relocation for symbol "
195194
<< Reloc.Symbol->getName()
196-
<< " is out-of-range. Cannot proceed without using -force-patch\n";
195+
<< " as it is out-of-range. To proceed must use -force-patch\n";
197196
exit(1);
198197
}
199198

bolt/unittests/Core/BinaryContext.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,8 @@ TEST_P(BinaryContextTester,
188188
EXPECT_EXIT(BS.flushPendingRelocations(
189189
OS, [&](const MCSymbol *S) { return 0x800000F; }),
190190
::testing::ExitedWithCode(1),
191-
"BOLT-ERROR: Cannot fully run scanExternalRefs as pending "
192-
"relocation for symbol Func0x4 is out-of-range. Cannot proceed "
193-
"without using -force-patch");
191+
"BOLT-ERROR: Cannot encode relocation for symbol Func0x4 as it is"
192+
" out-of-range. To proceed must use -force-patch");
194193
}
195194

196195
TEST_P(BinaryContextTester,

0 commit comments

Comments
 (0)