diff options
author | Fangrui Song <i@maskray.me> | 2023-03-03 12:48:16 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2023-03-03 12:48:16 -0800 |
commit | b30b1f173c911d9b04bbe70ad9b1e3c6c3cd6246 (patch) | |
tree | 726532b11d91addce9b43b431bdb74676c5a7949 /lld/ELF | |
parent | ffa11183303289654d26b8f761dcf54e611058ca (diff) | |
download | llvm-b30b1f173c911d9b04bbe70ad9b1e3c6c3cd6246.tar.gz |
[ELF] Add single quotes around out of range errors
to match the convention we use for other diagnostics.
Diffstat (limited to 'lld/ELF')
-rw-r--r-- | lld/ELF/Relocations.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp index fc0c022f8096..6f2280b678b4 100644 --- a/lld/ELF/Relocations.cpp +++ b/lld/ELF/Relocations.cpp @@ -101,7 +101,7 @@ void elf::reportRangeError(uint8_t *loc, const Relocation &rel, const Twine &v, std::string hint; if (rel.sym) { if (!rel.sym->isSection()) - hint = "; references " + lld::toString(*rel.sym); + hint = "; references '" + lld::toString(*rel.sym) + '\''; else if (auto *d = dyn_cast<Defined>(rel.sym)) hint = ("; references section '" + d->section->name + "'").str(); } @@ -124,7 +124,8 @@ void elf::reportRangeError(uint8_t *loc, int64_t v, int n, const Symbol &sym, ErrorPlace errPlace = getErrorPlace(loc); std::string hint; if (!sym.getName().empty()) - hint = "; references " + lld::toString(sym) + getDefinedLocation(sym); + hint = + "; references '" + lld::toString(sym) + '\'' + getDefinedLocation(sym); errorOrWarn(errPlace.loc + msg + " is out of range: " + Twine(v) + " is not in [" + Twine(llvm::minIntN(n)) + ", " + Twine(llvm::maxIntN(n)) + "]" + hint); |