fix set gp on riscv

master
WangRunji 6 years ago
parent c524941890
commit 227c552a45

@ -3,6 +3,13 @@
.text .text
.globl _start .globl _start
_start: _start:
# set gp
.option push
.option norelax
1: auipc gp, %pcrel_hi(__global_pointer$)
addi gp, gp, %pcrel_lo(1b)
.option pop
# call user-program function # call user-program function
LOAD a0, 0(sp) LOAD a0, 0(sp)
addi a1, sp, (__riscv_xlen / 8) addi a1, sp, (__riscv_xlen / 8)

Loading…
Cancel
Save