Skip to content

Commit 3fb83f6

Browse files
committed
[ELF] Replace toString(RelType) with operator<< while using ELFSyncStream
1 parent 612b779 commit 3fb83f6

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lld/ELF/InputSection.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,8 +1033,7 @@ void InputSection::relocateNonAlloc(Ctx &ctx, uint8_t *buf,
10331033
}
10341034
if (overwriteULEB128(bufLoc, val) >= 0x80)
10351035
Err(ctx) << getLocation(offset) << ": ULEB128 value " << Twine(val)
1036-
<< " exceeds available space; references '"
1037-
<< lld::toString(sym) << "'";
1036+
<< " exceeds available space; references '" << &sym << "'";
10381037
continue;
10391038
}
10401039
Err(ctx) << getLocation(offset)
@@ -1238,9 +1237,9 @@ void InputSectionBase::adjustSplitStackFunctionPrologues(Ctx &ctx, uint8_t *buf,
12381237
f->stOther))
12391238
continue;
12401239
if (!getFile<ELFT>()->someNoSplitStack)
1241-
ErrAlways(ctx)
1242-
<< lld::toString(this) << ": " << f->getName()
1243-
<< " (with -fsplit-stack) calls " << rel.sym->getName()
1240+
Err(ctx)
1241+
<< this << ": " << f->getName() << " (with -fsplit-stack) calls "
1242+
<< rel.sym->getName()
12441243
<< " (without -fsplit-stack), but couldn't adjust its prologue";
12451244
}
12461245
}

lld/ELF/Writer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2805,7 +2805,7 @@ template <class ELFT> void Writer<ELFT>::openFile() {
28052805

28062806
if (!bufferOrErr) {
28072807
ErrAlways(ctx) << "failed to open " << ctx.arg.outputFile << ": "
2808-
<< llvm::toString(bufferOrErr.takeError());
2808+
<< bufferOrErr.takeError();
28092809
return;
28102810
}
28112811
buffer = std::move(*bufferOrErr);

0 commit comments

Comments
 (0)