mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 22:24:07 +00:00
Add register Mips::GP to the list of reserved registers if target is bare-metal
to prevent it from being clobbered. mips uses $gp to access small data section. This bug was originally reported by Carl Norum. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162340 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -25,7 +25,8 @@ using namespace llvm;
|
||||
void MipsSubtarget::anchor() { }
|
||||
|
||||
MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
|
||||
const std::string &FS, bool little) :
|
||||
const std::string &FS, bool little,
|
||||
Reloc::Model RM) :
|
||||
MipsGenSubtargetInfo(TT, CPU, FS),
|
||||
MipsArchVersion(Mips32), MipsABI(UnknownABI), IsLittle(little),
|
||||
IsSingleFloat(false), IsFP64bit(false), IsGP64bit(false), HasVFPU(false),
|
||||
@ -54,6 +55,9 @@ MipsSubtarget::MipsSubtarget(const std::string &TT, const std::string &CPU,
|
||||
// Is the target system Linux ?
|
||||
if (TT.find("linux") == std::string::npos)
|
||||
IsLinux = false;
|
||||
|
||||
// Set UseSmallSection.
|
||||
UseSmallSection = !IsLinux && (RM == Reloc::Static);
|
||||
}
|
||||
|
||||
bool
|
||||
|
Reference in New Issue
Block a user