diff options
| author | George Rimar <grimar@accesssoftek.com> | 2018-07-17 09:37:53 +0000 |
|---|---|---|
| committer | George Rimar <grimar@accesssoftek.com> | 2018-07-17 09:37:53 +0000 |
| commit | 448ef7793d549fdbc5350f0c1a43c13ab7c6ac07 (patch) | |
| tree | 3aabc783417cb50aa93eb84ee1b49d32ec7d1953 | |
| parent | 0aa117dd2c57608903a0b79e2661f4f5bff42dc1 (diff) | |
| download | bcm5719-llvm-448ef7793d549fdbc5350f0c1a43c13ab7c6ac07.tar.gz bcm5719-llvm-448ef7793d549fdbc5350f0c1a43c13ab7c6ac07.zip | |
[ELF] - Check we able to report function symbols that encloses a location in error messages.
InputSectionBase::getLocation() have the following block of the code which
is uncovered by our test cases:
https://github.com/llvm-mirror/lld/blob/master/ELF/InputSection.cpp#L238
Patch adds a test to trigger this branch.
llvm-svn: 337256
| -rw-r--r-- | lld/test/ELF/x86-64-reloc-error2.s | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lld/test/ELF/x86-64-reloc-error2.s b/lld/test/ELF/x86-64-reloc-error2.s new file mode 100644 index 00000000000..d49b6752265 --- /dev/null +++ b/lld/test/ELF/x86-64-reloc-error2.s @@ -0,0 +1,14 @@ +# REQUIRES: x86 +# RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o +# RUN: not ld.lld %t.o -o /dev/null 2>&1 | FileCheck %s + +## Check we are able to find a function symbol that encloses +## a given location when reporting error messages. +# CHECK: {{.*}}.o:(function func): relocation R_X86_64_32S out of range: -281474974609408 is not in [-2147483648, 2147483647] + +.section .text.func, "ax", %progbits +.globl func +.type func,@function +.size func, 0x10 +func: + movq func - 0x1000000000000, %rdx |

