[mac/lld] Include archive name in diagnostics
authorNico Weber <thakis@chromium.org>
Wed, 2 Dec 2020 00:00:48 +0000 (19:00 -0500)
committerNico Weber <thakis@chromium.org>
Wed, 2 Dec 2020 04:00:25 +0000 (23:00 -0500)
commitb2f00f24a3c4983a977ff3d975962e7f9dfb887e
tree7292207805e8941ac7bc56642c965f14f75e88ef
parent0cca3286812c071b167d811c51eb30ee24dba1cd
[mac/lld] Include archive name in diagnostics

Also, for .o files, include full path as given on link command line.

Before:
    lld: error: undefined symbol [...], referenced from sandbox_logging.o

After:
    lld: error: undefined symbol [...], referenced from libseatbelt.a(sandbox_logging.o)

Move archiveName up to InputFile so we can consistently use toString()
to print InputFiles in diags, and pass it to the ObjFile ctor. This
matches the ELF and COFF ports.

Differential Revision: https://reviews.llvm.org/D92437
lld/ELF/InputFiles.h
lld/MachO/Driver.cpp
lld/MachO/InputFiles.cpp
lld/MachO/InputFiles.h
lld/MachO/LTO.cpp
lld/MachO/Writer.cpp
lld/test/MachO/invalid/undefined-symbol.s