[ELF] - Print absolute file name in errors when possible.
authorGeorge Rimar <grimar@accesssoftek.com>
Wed, 7 Dec 2016 19:42:25 +0000 (19:42 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Wed, 7 Dec 2016 19:42:25 +0000 (19:42 +0000)
commit92c88a4f764bfb7fab7a96f07acbd39a69382290
tree9e656c41ad5e5005c4e02a2f31221bd5f946a280
parent5842b20633ef3b244a2d583cf0d209b4ea57a911
[ELF] - Print absolute file name in errors when possible.

Currently LLD prints basename of source file name in error messages,
for example:
$ mkdir foo
$ echo 'void _start(void) { foobar(); }' > foo/bar.c
$ gcc -g -c foo/bar.c
$ bin/ld.lld -o out bar.o
bin/ld.lld: error: bar.c:1: undefined symbol 'foobar'
$
This should say:
bin/ld.lld: error: foo/bar.c:1: undefined symbol 'foobar'

This is PR31299

Differential revision: https://reviews.llvm.org/D27506

llvm-svn: 288966
lld/ELF/InputFiles.cpp
lld/include/lld/Core/Reproduce.h
lld/lib/Core/Reproduce.cpp
lld/test/ELF/Inputs/undef-debug.s
lld/test/ELF/undef.s