diff options
author | Hans Wennborg <hans@hanshq.net> | 2019-08-26 08:35:17 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2019-08-26 08:35:17 +0000 |
commit | cc79e7079b75c9cd7e956256798f104f3b51e3d1 (patch) | |
tree | 9824e0b048461225dba24e9fe1f0d04dc2cb17df /COFF/InputFiles.cpp | |
parent | 34438eeb1452c44772ea5d279e7f5ba808d54b0a (diff) |
Merging r366836:
------------------------------------------------------------------------
r366836 | nico | 2019-07-23 21:00:01 +0200 (Tue, 23 Jul 2019) | 24 lines
ld.lld: Demangle symbols from archives in diagnostics
This ports r366573 from COFF to ELF.
There are now to toString(Archive::Symbol), one doing MSVC demangling
in COFF and one doing Itanium demangling in ELF, so rename these two
to toCOFFString() and to toELFString() to not get a duplicate symbol.
Nothing ever passes a raw Archive::Symbol to CHECK(), so these not
being part of the normal toString() machinery seems ok.
There are two code paths in the ELF linker that emits this type of
diagnostic:
1. The "normal" one in InputFiles.cpp. This is covered by the tweaked test.
2. An additional one that's only used for libcalls if there's at least
one bitcode in the link, and if the libcall symbol is lazy, and
lazily loaded from an archive (i.e. not from a lazy .o file).
(This code path was added in r339301.) Since all libcall names so far
are C symbols and never mangled, the change there is not observable
and hence not covered by tests.
Differential Revision: https://reviews.llvm.org/D65095
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/lld/branches/release_90@369882 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'COFF/InputFiles.cpp')
-rw-r--r-- | COFF/InputFiles.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/COFF/InputFiles.cpp b/COFF/InputFiles.cpp index c72fa587a..d02fedfd1 100644 --- a/COFF/InputFiles.cpp +++ b/COFF/InputFiles.cpp @@ -86,8 +86,9 @@ void ArchiveFile::parse() { // Returns a buffer pointing to a member file containing a given symbol. void ArchiveFile::addMember(const Archive::Symbol &sym) { - const Archive::Child &c = CHECK( - sym.getMember(), "could not get the member for symbol " + toString(sym)); + const Archive::Child &c = + CHECK(sym.getMember(), + "could not get the member for symbol " + toCOFFString(sym)); // Return an empty buffer if we have already returned the same buffer. if (!seen.insert(c.getChildOffset()).second) |