[PATCH] D63344: lld/elf: Deduplicate undefined symbol diagnostics
Nico Weber via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 14 09:56:58 PDT 2019
thakis created this revision.
thakis added a reviewer: ruiu.
Herald added subscribers: MaskRay, arichardson, emaste.
Herald added a reviewer: espindola.
Herald added a project: LLVM.
thakis added a parent revision: D63343: lld/elf: Serialize undefined symbol diagnostics, emit them in one go later.
Before:
ld.lld: error: undefined symbol: f()
>>> referenced by test.cc:3
>>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(g())
ld.lld: error: undefined symbol: f()
>>> referenced by test.cc:4
>>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(h())
ld.lld: error: undefined symbol: f()
>>> referenced by test.cc:5
>>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(j())
ld.lld: error: undefined symbol: k()
>>> referenced by test.cc:5
>>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(j())
ld.lld: error: undefined symbol: f()
>>> referenced by test2.cc:2
>>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test2-07b391.o:(asdf())
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Now:
ld.lld: error: undefined symbol: f()
>>> referenced by test.cc:3
>>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(g())
>>> referenced by test.cc:4
>>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(h())
>>> referenced by test.cc:5
>>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(j())
>>> referenced by test2.cc:2
>>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test2-6bdb24.o:(asdf())
ld.lld: error: undefined symbol: k()
>>> referenced by test.cc:5
>>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(j())
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Every "referenced by" counts as 1 error, so -error-limit should still have about the same effect as it had before.
Fixes PR42260.
https://reviews.llvm.org/D63344
Files:
lld/Common/ErrorHandler.cpp
lld/ELF/Relocations.cpp
lld/include/lld/Common/ErrorHandler.h
lld/test/ELF/debug-line-obj.s
lld/test/ELF/undef-multi.s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63344.204800.patch
Type: text/x-patch
Size: 6632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190614/24b1eec7/attachment.bin>
More information about the llvm-commits
mailing list