We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 699312f commit 08f01baCopy full SHA for 08f01ba
src/device/riscv/start.S
@@ -3,11 +3,10 @@
3
.type _start,@function
4
5
_start:
6
- // Workaround for missing support of the la pseudo-instruction in Clang 8:
7
- // https://reviews.llvm.org/D55325
8
- lui sp, %hi(_stack_top)
9
- addi sp, sp, %lo(_stack_top)
10
- // see https://gnu-mcu-eclipse.github.io/arch/riscv/programmer/#the-gp-global-pointer-register
11
- lui gp, %hi(__global_pointer$)
12
- addi gp, gp, %lo(__global_pointer$)
+ // Load the stack pointer.
+ la sp, _stack_top
+ // Load the globals pointer. The program will load pointers relative to this
+ // register, so it must be set to the right value on startup.
+ // See: https://gnu-mcu-eclipse.github.io/arch/riscv/programmer/#the-gp-global-pointer-register
+ la gp, __global_pointer$
13
call main
0 commit comments