mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +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:
@ -60,9 +60,10 @@ bool MipsTargetObjectFile::
|
||||
IsGlobalInSmallSection(const GlobalValue *GV, const TargetMachine &TM,
|
||||
SectionKind Kind) const {
|
||||
|
||||
// Only use small section for non linux targets.
|
||||
const MipsSubtarget &Subtarget = TM.getSubtarget<MipsSubtarget>();
|
||||
if (Subtarget.isLinux())
|
||||
|
||||
// Return if small section is not available.
|
||||
if (!Subtarget.useSmallSection())
|
||||
return false;
|
||||
|
||||
// Only global variables, not functions.
|
||||
|
Reference in New Issue
Block a user