summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-07 22:35:13 +0000
committerChris Lattner <sabre@nondot.org>2010-07-07 22:35:13 +0000
commitda3051a17f586b069951931eeed9317cad41243b (patch)
tree95a9a4fffc78fae1cd46233928b550d52891ad00
parent9fc05227a2596c545b845ed9a72673995e49d16b (diff)
downloadexternal_llvm-da3051a17f586b069951931eeed9317cad41243b.zip
external_llvm-da3051a17f586b069951931eeed9317cad41243b.tar.gz
external_llvm-da3051a17f586b069951931eeed9317cad41243b.tar.bz2
finish up support for callw: PR7195
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107826 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/MC/MachObjectWriter.cpp2
-rw-r--r--lib/Target/X86/X86MCCodeEmitter.cpp2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/MC/MachObjectWriter.cpp b/lib/MC/MachObjectWriter.cpp
index fbe068b..7ca0951 100644
--- a/lib/MC/MachObjectWriter.cpp
+++ b/lib/MC/MachObjectWriter.cpp
@@ -33,6 +33,7 @@ static unsigned getFixupKindLog2Size(unsigned Kind) {
default: llvm_unreachable("invalid fixup kind!");
case X86::reloc_pcrel_1byte:
case FK_Data_1: return 0;
+ case X86::reloc_pcrel_2byte:
case FK_Data_2: return 1;
case X86::reloc_pcrel_4byte:
case X86::reloc_riprel_4byte:
@@ -47,6 +48,7 @@ static bool isFixupKindPCRel(unsigned Kind) {
default:
return false;
case X86::reloc_pcrel_1byte:
+ case X86::reloc_pcrel_2byte:
case X86::reloc_pcrel_4byte:
case X86::reloc_riprel_4byte:
case X86::reloc_riprel_4byte_movq_load:
diff --git a/lib/Target/X86/X86MCCodeEmitter.cpp b/lib/Target/X86/X86MCCodeEmitter.cpp
index 24c48fd..af1b406 100644
--- a/lib/Target/X86/X86MCCodeEmitter.cpp
+++ b/lib/Target/X86/X86MCCodeEmitter.cpp
@@ -201,7 +201,7 @@ EmitImmediate(const MCOperand &DispOp, unsigned Size, MCFixupKind FixupKind,
FixupKind == MCFixupKind(X86::reloc_riprel_4byte_movq_load))
ImmOffset -= 4;
if (FixupKind == MCFixupKind(X86::reloc_pcrel_2byte))
- ImmOffset -= 4;// FIXME: This should be 2, but 'as' produces an offset of 4.
+ ImmOffset -= 2;
if (FixupKind == MCFixupKind(X86::reloc_pcrel_1byte))
ImmOffset -= 1;