diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-03-18 21:53:54 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-03-18 21:53:54 +0000 |
commit | 9fdac902d4300f2b0b8f4830ff276cc8199864b5 (patch) | |
tree | 6976f43013cad8e6fa622c3f6bb2c798a2a65078 /lib | |
parent | f506b6b4718d8343c1133daca468e767cd5fb7ab (diff) | |
download | external_llvm-9fdac902d4300f2b0b8f4830ff276cc8199864b5.zip external_llvm-9fdac902d4300f2b0b8f4830ff276cc8199864b5.tar.gz external_llvm-9fdac902d4300f2b0b8f4830ff276cc8199864b5.tar.bz2 |
X86MCCodeEmitter: Fix two minor issues with reloc_riprel_4byte_movq_load, we
were missing it on some movq instructions and were not including the appropriate
PCrel bias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98880 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/X86/X86MCCodeEmitter.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Target/X86/X86MCCodeEmitter.cpp b/lib/Target/X86/X86MCCodeEmitter.cpp index f533b15..5afbe70 100644 --- a/lib/Target/X86/X86MCCodeEmitter.cpp +++ b/lib/Target/X86/X86MCCodeEmitter.cpp @@ -166,7 +166,8 @@ EmitImmediate(const MCOperand &DispOp, unsigned Size, MCFixupKind FixupKind, // If the fixup is pc-relative, we need to bias the value to be relative to // the start of the field, not the end of the field. if (FixupKind == MCFixupKind(X86::reloc_pcrel_4byte) || - FixupKind == MCFixupKind(X86::reloc_riprel_4byte)) + FixupKind == MCFixupKind(X86::reloc_riprel_4byte) || + FixupKind == MCFixupKind(X86::reloc_riprel_4byte_movq_load)) ImmOffset -= 4; if (FixupKind == MCFixupKind(X86::reloc_pcrel_1byte)) ImmOffset -= 1; @@ -203,7 +204,8 @@ void X86MCCodeEmitter::EmitMemModRMByte(const MCInst &MI, unsigned Op, // movq loads are handled with a special relocation form which allows the // linker to eliminate some loads for GOT references which end up in the // same linkage unit. - if (MI.getOpcode() == X86::MOV64rm_TC) + if (MI.getOpcode() == X86::MOV64rm || + MI.getOpcode() == X86::MOV64rm_TC) FixupKind = X86::reloc_riprel_4byte_movq_load; // rip-relative addressing is actually relative to the *next* instruction. |