mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
[x86 frame lowering] In 32-bit mode, use ESI as the base pointer.
Previously, we were using EBX, but PIC requires the GOT to be in EBX before function calls via PLT GOT pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161066 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -72,13 +72,15 @@ X86RegisterInfo::X86RegisterInfo(X86TargetMachine &tm,
|
||||
SlotSize = 8;
|
||||
StackPtr = X86::RSP;
|
||||
FramePtr = X86::RBP;
|
||||
BasePtr = X86::RBX;
|
||||
} else {
|
||||
SlotSize = 4;
|
||||
StackPtr = X86::ESP;
|
||||
FramePtr = X86::EBP;
|
||||
BasePtr = X86::EBX;
|
||||
}
|
||||
// Use a callee-saved register as the base pointer. These registers must
|
||||
// not conflict with any ABI requirements. For example, in 32-bit mode PIC
|
||||
// requires GOT in the EBX register before function calls via PLT GOT pointer.
|
||||
BasePtr = Is64Bit ? X86::RBX : X86::ESI;
|
||||
}
|
||||
|
||||
/// getCompactUnwindRegNum - This function maps the register to the number for
|
||||
|
||||
Reference in New Issue
Block a user