[ELF] - Do not call fatal() in Target.cpp, call error() instead.
authorGeorge Rimar <grimar@accesssoftek.com>
Wed, 21 Dec 2016 08:21:34 +0000 (08:21 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Wed, 21 Dec 2016 08:21:34 +0000 (08:21 +0000)
commitdcf5b72e20e331ee90450029033bb993dbf69cbd
tree10fa699538cc3271e4f481da411c0a1c826ab729
parent4fb6e79c65527b5617fe859c4c4a7d232281d2dd
[ELF] - Do not call fatal() in Target.cpp, call error() instead.

We probably would want to avoid fatal() if we can in context of librarification,
but for me reason of that patch is to help D27900 go.

D27900 changes errors reporting to something like
error: text1
note: text2
note: text3

where hint used to provide additional information about location. In that case
I can't just call fatal() because user will not see notes after that what adds additional complication to handle.
So It is good to switch fatal() to error() where it is possible.

Also it adds testcase with broken relocation number.
Previously we did not have any, It checks that error() instead of fatal() works fine.

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

llvm-svn: 290239
lld/ELF/Target.cpp
lld/test/ELF/invalid/Inputs/invalid-relocation-x64.elf [new file with mode: 0644]
lld/test/ELF/invalid/invalid-relocation-x64.s [new file with mode: 0644]