Check pc relative relocations too.

llvm-svn: 270264
This commit is contained in:
Rafael Espindola 2016-05-20 20:02:27 +00:00
parent bc0a68e688
commit fb0ceb5153
2 changed files with 14 additions and 0 deletions

View File

@ -714,6 +714,7 @@ void X86_64TargetInfo::relocateOne(uint8_t *Loc, uint32_t Type,
case R_X86_64_TLSLD:
case R_X86_64_DTPOFF32:
case R_X86_64_SIZE32:
checkInt<32>(Val, Type);
write32le(Loc, Val);
break;
default:

View File

@ -0,0 +1,13 @@
// RUN: llvm-mc %s -o %t.o -triple x86_64-pc-linux -filetype=obj
// RUN: not ld.lld %t.o -o %t.so -shared 2>&1 | FileCheck %s
// CHECK: relocation R_X86_64_PC32 out of range
// CHECK-NOT: relocation
lea foo(%rip), %rax
lea foo(%rip), %rax
.hidden foo
.bss
.zero 0x7fffe007
foo: