From 6f4a19f59f99d7e84605d3eb1ac4fe49cea2b9b8 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Nov 2013 04:45:05 +0100 Subject: [PATCH] Use $t9 for indirect calls from asm to C as PIC ABI requires. --- ChangeLog | 4 ++++ grub-core/boot/mips/startup_raw.S | 8 ++++---- grub-core/kern/mips/startup.S | 6 +++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e2ceeb3e..856185496 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-11-22 Vladimir Serbinenko + + Use $t9 for indirect calls from asm to C as PIC ABI requires. + 2013-11-22 Vladimir Serbinenko Remove -march=mips3 from TARGET_CCASFLAGS as it creates linking problem diff --git a/grub-core/boot/mips/startup_raw.S b/grub-core/boot/mips/startup_raw.S index 606197624..9e4a7e6d9 100644 --- a/grub-core/boot/mips/startup_raw.S +++ b/grub-core/boot/mips/startup_raw.S @@ -265,16 +265,16 @@ cmdlinedone: */ move $s6, $a3 - lui $t0, %hi(EXT_C(grub_decompress_core)) - addiu $t0, $t0, %lo(EXT_C(grub_decompress_core)) + lui $t9, %hi(EXT_C(grub_decompress_core)) + addiu $t9, $t9, %lo(EXT_C(grub_decompress_core)) #ifdef GRUB_MACHINE_ARC lui $sp, %hi(_start - 512) - jalr $t0 + jalr $t9 addiu $sp, $sp, %lo(_start - 512) #else lui $sp, %hi(_start - 256) - jalr $t0 + jalr $t9 addiu $sp, $sp, %lo(_start - 256) #endif move $a0, $s1 diff --git a/grub-core/kern/mips/startup.S b/grub-core/kern/mips/startup.S index 35a11bcf8..709a91afa 100644 --- a/grub-core/kern/mips/startup.S +++ b/grub-core/kern/mips/startup.S @@ -116,10 +116,10 @@ bsscont: bne $t3, $0, bsscont nop - lui $t1, %hi(grub_main) - addiu $t1, %lo(grub_main) + lui $t9, %hi(grub_main) + addiu $t9, %lo(grub_main) lui $sp, %hi(GRUB_MACHINE_MEMORY_STACK_HIGH) - jr $t1 + jr $t9 addiu $sp, $sp, %lo(GRUB_MACHINE_MEMORY_STACK_HIGH)