summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Relocations.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2016-11-21 13:49:57 +0000
committerRui Ueyama <ruiu@google.com>2016-11-21 13:49:57 +0000
commite8785ba4d7fab0c537d381a1438dd82cb093d514 (patch)
treefc1fe24de6d1fb88be17e0c2d0316cb7983ddd7d /lld/ELF/Relocations.cpp
parent68dd881697531f45b0260cb3dba56804986c8fa6 (diff)
downloadbcm5719-llvm-e8785ba4d7fab0c537d381a1438dd82cb093d514.tar.gz
bcm5719-llvm-e8785ba4d7fab0c537d381a1438dd82cb093d514.zip
Change the way how we print out line numbers.
LLD's error messages contain line numbers, function names or section names. Currently they are formatter as follows. foo.c (32): symbol 'foo' not found foo.c (function bar): symbol 'foo' not found foo.c (.text+0x1234): symbol 'foo' not found This patch changes them so that they are consistent with Clang's output. foo.c:32: symbol 'foo' not found foo.c:(function bar): symbol 'foo' not found foo.c:(.text+0x1234): symbol 'foo' not found Differential Revision: https://reviews.llvm.org/D26901 llvm-svn: 287537
Diffstat (limited to 'lld/ELF/Relocations.cpp')
-rw-r--r--lld/ELF/Relocations.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 8bcf4d25d4e..d6bfe10adab 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -554,11 +554,11 @@ std::string getLocation(InputSectionBase<ELFT> &S, typename ELFT::uint Offset) {
DefinedRegular<ELFT> *Encl = getSymbolAt(&S, Offset);
if (Encl && Encl->Type == STT_FUNC) {
StringRef Func = getSymbolName(File->getStringTable(), *Encl);
- return SrcFile + " (function " + maybeDemangle(Func) + ")";
+ return SrcFile + ":(function " + maybeDemangle(Func) + ")";
}
// If there's no symbol, print out the offset instead of a symbol name.
- return (SrcFile + " (" + S.Name + "+0x" + Twine::utohexstr(Offset) + ")")
+ return (SrcFile + ":(" + S.Name + "+0x" + Twine::utohexstr(Offset) + ")")
.str();
}
OpenPOWER on IntegriCloud