Skip to content

Commit 1bb9af5

Browse files
Addressing reviewers (2)
1 parent f0b43e9 commit 1bb9af5

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
@@ -1795,7 +1795,7 @@ bool BinaryFunction::scanExternalRefs() {
17951795
// Create relocation for every fixup.
17961796
for (const MCFixup &Fixup : Fixups) {
17971797
std::optional<Relocation> Rel = BC.MIB->createRelocation(Fixup, *BC.MAB);
1798-
// Can be skipped under the right circumstances.
1798+
// Can be skipped in case of overlow during relocation value encoding.
17991799
Rel->setOptional();
18001800
if (!Rel) {
18011801
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)