Skip to content

Commit f1e3033

Browse files
committed
tools/nolibc: MIPS: drop $gp setup
The setup of the global pointer "$gp" register was necessary when the C entrypoint was called through "jal <symbol>". However since commit 0daf8c8 ("tools/nolibc: mips: load current function to $t9") "jalr" is used instead which does not require "$gp". Remove the unnecessary $gp setup, simplifying the code and opening the road for some other cleanups. Suggested-by: Maciej W. Rozycki <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Thomas Weißschuh <[email protected]> Tested-by: Sebastian Andrzej Siewior <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 01e8a6d commit f1e3033

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

tools/include/nolibc/arch-mips.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,7 @@ void __attribute__((weak, noreturn)) __nolibc_entrypoint __no_stack_protector __
185185
__asm__ volatile (
186186
".set push\n"
187187
".set noreorder\n"
188-
"bal 1f\n" /* prime $ra for .cpload */
189-
"nop\n"
190-
"1:\n"
191-
".cpload $ra\n"
192188
"move $a0, $sp\n" /* save stack pointer to $a0, as arg1 of _start_c */
193-
"addiu $sp, $sp, -4\n" /* space for .cprestore to store $gp */
194-
".cprestore 0\n"
195189
"li $t0, -8\n"
196190
"and $sp, $sp, $t0\n" /* $sp must be 8-byte aligned */
197191
"addiu $sp, $sp, -16\n" /* the callee expects to save a0..a3 there */

0 commit comments

Comments
 (0)