[ELF] Allow --noinhibit-exec to produce corrupted executable with relocation overflow
authorFangrui Song <maskray@google.com>
Tue, 20 Nov 2018 17:04:11 +0000 (17:04 +0000)
committerFangrui Song <maskray@google.com>
Tue, 20 Nov 2018 17:04:11 +0000 (17:04 +0000)
commit537a5bfb7f1e9b85d615df95d7facacb5fb1638b
tree38a1e34ec0f98851c692f04306851d5246e91bc9
parentbac49ac455f01db9c986dbfbae83b17ebe796864
[ELF] Allow --noinhibit-exec to produce corrupted executable with relocation overflow

Summary:
When --noinhibit-exec is used, ld.bfd/gold emit errors but allow to produce corrupted executable, which is handy for debugging purpose. lld's --noinhibit-exec has a different meaning and changes some errors to warnings. This patch replaces "error" with "errorOrWarn" to exploit that property.

We may revisit this: if we should keep them as errors (as ld.bfd/gold do) but allow to produce a (corrupted) executable.

Reviewers: ruiu, grimar, espindola

Reviewed By: grimar

Subscribers: Timmmm, jhenderson, emaste, arichardson, llvm-commits

Differential Revision: https://reviews.llvm.org/D54651

llvm-svn: 347327
lld/ELF/Target.h
lld/test/ELF/x86-64-reloc-range.s