1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Handle 16 bit PC relative relocations.

Fixes pr23771.

llvm-svn: 239214
This commit is contained in:
Rafael Espindola 2015-06-06 02:29:56 +00:00
parent 5353c0fe56
commit dc62dbfafc
2 changed files with 6 additions and 0 deletions

View File

@ -66,6 +66,7 @@ static X86_64RelType getType64(unsigned Kind,
case X86::reloc_riprel_4byte:
case X86::reloc_riprel_4byte_movq_load:
return RT64_32;
case FK_PCRel_2:
case FK_Data_2:
return RT64_16;
case FK_PCRel_1:

View File

@ -54,6 +54,10 @@ bar:
.quad pr23272_2 - pr23272
.quad pr23272_3 - pr23272
.code16
call pr23771
// CHECK: Section {
// CHECK: Name: .rela.text
// CHECK: Relocations [
@ -90,5 +94,6 @@ bar:
// CHECK-NEXT: 0xD4 R_X86_64_SIZE32 blah 0xFFFFFFFFFFFFFFE0
// CHECK-NEXT: 0xD8 R_X86_64_GOTPCREL foo 0x0
// CHECK-NEXT: 0xDC R_X86_64_PLT32 foo 0x0
// CHECK-NEXT: 0xF1 R_X86_64_PC16 pr23771 0xFFFFFFFFFFFFFFFE
// CHECK-NEXT: ]
// CHECK-NEXT: }