Skip to content

Commit a6755bd

Browse files
committed
[ELF] Replace global ctx with getCtx()
1 parent 64b9753 commit a6755bd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lld/ELF/InputSection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ std::string InputSectionBase::getLocation(uint64_t offset) const {
309309
std::string secAndOffset =
310310
(name + "+0x" + Twine::utohexstr(offset) + ")").str();
311311

312-
std::string filename = toStr(ctx, file);
312+
std::string filename = toStr(getCtx(), file);
313313
if (Defined *d = getEnclosingFunction(offset))
314314
return filename + ":(function " + toStr(getCtx(), *d) + ": " + secAndOffset;
315315

@@ -347,7 +347,7 @@ std::string InputSectionBase::getObjMsg(uint64_t off) const {
347347
// before ObjFile::initSectionsAndLocalSyms where local symbols are
348348
// initialized.
349349
if (Defined *d = getEnclosingSymbol(off))
350-
return filename + ":(" + toStr(ctx, *d) + ")" + archive;
350+
return filename + ":(" + toStr(getCtx(), *d) + ")" + archive;
351351

352352
// If there's no symbol, print out the offset in the section.
353353
return (filename + ":(" + name + "+0x" + utohexstr(off) + ")" + archive)

lld/ELF/Symbols.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ void elf::printTraceSymbol(const Symbol &sym, StringRef name) {
295295
else
296296
s = ": definition of ";
297297

298-
message(toStr(ctx, sym.file) + s + name);
298+
message(toStr(sym.file->ctx, sym.file) + s + name);
299299
}
300300

301301
static void recordWhyExtract(Ctx &ctx, const InputFile *reference,

0 commit comments

Comments
 (0)