[PATCH] D65095: ld.lld: Demangle symbols from archives in diagnostics

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 22 08:24:27 PDT 2019


thakis created this revision.
thakis added a reviewer: ruiu.
Herald added subscribers: erik.pilkington, MaskRay, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D65095

Files:
  lld/COFF/Driver.cpp
  lld/COFF/InputFiles.cpp
  lld/COFF/Symbols.cpp
  lld/COFF/Symbols.h
  lld/ELF/InputFiles.cpp
  lld/ELF/Symbols.cpp
  lld/ELF/Symbols.h
  lld/test/ELF/archive-thin-missing-member.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65095.211110.patch
Type: text/x-patch
Size: 8101 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190722/288beb97/attachment.bin>


More information about the llvm-commits mailing list