The LLVM assembler reportedly assembles the form using the j mnemonic incorrectly (see issue 107460). The jr form is canonical and avoids this problem, so use it instead.
@@ -3,11 +3,11 @@
.section .init
lw $gp,24($sp)
lw $ra,28($sp)
- j $ra
+ jr $ra
addu $sp,$sp,32
.section .fini
ld $gp,16($sp)
ld $ra,24($sp)
daddu $sp,$sp,32
@@ -2,11 +2,11 @@
ld $gp, 16($sp)
ld $ra, 24($sp)
addu $sp, $sp, 32