risc-v: disable linker relaxations during gp init

Этот коммит содержится в:
Yannis Huber 2020-07-07 09:37:00 +02:00 коммит произвёл Ayke
родитель 0b94e486c1
коммит 7ed7e6cb11

Просмотреть файл

@ -9,7 +9,12 @@ _start:
// Load the globals pointer. The program will load pointers relative to this // Load the globals pointer. The program will load pointers relative to this
// register, so it must be set to the right value on startup. // 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 // See: https://gnu-mcu-eclipse.github.io/arch/riscv/programmer/#the-gp-global-pointer-register
// Linker relaxations must be disabled to avoid the initialization beign
// relaxed with an uninitialized global pointer: mv gp, gp
.option push
.option norelax
la gp, __global_pointer$ la gp, __global_pointer$
.option pop
// Jump to runtime.main // Jump to runtime.main
call main call main