rv64: Misc relaxation related fixes

This commit is contained in:
mintsuki 2023-08-01 05:06:40 -05:00
parent 2d0752f60c
commit 50b8ab2c26
7 changed files with 9 additions and 2 deletions

View File

@ -128,7 +128,8 @@ ifeq ($(TARGET),uefi-riscv64)
endif
override CFLAGS_FOR_TARGET += \
-mabi=lp64
-mabi=lp64 \
-mno-relax
override CPPFLAGS_FOR_TARGET := \
-I'$(call SHESCAPE,$(BUILDDIR))/limine-efi/inc' \

View File

@ -3,6 +3,7 @@
.global efi_main
.extern uefi_entry
efi_main:
.option norelax
mv fp, zero
mv ra, zero
j uefi_entry

View File

@ -3,7 +3,7 @@
.global riscv_spinup
riscv_spinup:
.option norelax
csrci sstatus, 0x2
csrw sie, zero
csrw stvec, zero

View File

@ -60,6 +60,8 @@ SECTIONS
data_begin = .;
*(.data .data.*)
*(.sdata .sdata.*)
*(.sbss .sbss.*)
*(.bss .bss.*)
*(COMMON)
data_end = .;

View File

@ -10,6 +10,7 @@ stack_at_first_entry:
.extern _menu
menu:
.option norelax
lla t0, stack_at_first_entry
ld t1, (t0)
beqz t1, 1f

View File

@ -2,6 +2,7 @@
.global sbicall
sbicall:
.option norelax
mv t0, a0
mv t1, a1
mv a0, a2

View File

@ -2,6 +2,7 @@
.global smp_trampoline_start
smp_trampoline_start:
.option norelax
// The AP begins executing here with the following state:
// satp = 0
// sstatus.SIE = 0