mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Preliminary PIC JIT support for X86 (32-bit) / Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45313 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -437,7 +437,14 @@ void X86JITInfo::relocate(void *Function, MachineRelocation *MR,
|
||||
case X86::reloc_pcrel_word: {
|
||||
// PC relative relocation, add the relocated value to the value already in
|
||||
// memory, after we adjust it for where the PC is.
|
||||
ResultPtr = ResultPtr-(intptr_t)RelocPos-4-MR->getConstantVal();
|
||||
ResultPtr = ResultPtr -(intptr_t)RelocPos - 4 - MR->getConstantVal();
|
||||
*((unsigned*)RelocPos) += (unsigned)ResultPtr;
|
||||
break;
|
||||
}
|
||||
case X86::reloc_picrel_word: {
|
||||
// PIC base relative relocation, add the relocated value to the value
|
||||
// already in memory, after we adjust it for where the PIC base is.
|
||||
ResultPtr = ResultPtr - ((intptr_t)Function + MR->getConstantVal());
|
||||
*((unsigned*)RelocPos) += (unsigned)ResultPtr;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user