[llvm] r239214 - Handle 16 bit PC relative relocations.
Rafael Espindola
rafael.espindola at gmail.com
Fri Jun 5 19:29:56 PDT 2015
Author: rafael
Date: Fri Jun 5 21:29:56 2015
New Revision: 239214
URL: http://llvm.org/viewvc/llvm-project?rev=239214&view=rev
Log:
Handle 16 bit PC relative relocations.
Fixes pr23771.
Modified:
llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
llvm/trunk/test/MC/ELF/relocation.s
Modified: llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp?rev=239214&r1=239213&r2=239214&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp (original)
+++ llvm/trunk/lib/Target/X86/MCTargetDesc/X86ELFObjectWriter.cpp Fri Jun 5 21:29:56 2015
@@ -66,6 +66,7 @@ static X86_64RelType getType64(unsigned
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:
Modified: llvm/trunk/test/MC/ELF/relocation.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ELF/relocation.s?rev=239214&r1=239213&r2=239214&view=diff
==============================================================================
--- llvm/trunk/test/MC/ELF/relocation.s (original)
+++ llvm/trunk/test/MC/ELF/relocation.s Fri Jun 5 21:29:56 2015
@@ -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: }
More information about the llvm-commits
mailing list