forked from Mirrors/opensbi
fw_base.S: Fix assembler error with clang 16+
Attempting to build OpenSBI with clang 16 and the following command:
$ make LLVM=1 PLATFORM=generic
Results in the following error:
AS platform/generic/firmware/fw_dynamic.o
/tmp/fw_dynamic-d000a6.s:429:9: error: symbol '_fw_start' can not be undefined in a subtraction expression
.dword _fw_rw_start - _fw_start
Work around this issue by eliminating the __fw_rw_offset variable and
performing the offset calculation at run-time instead. This takes
advantage of the fact that the a4 register contains the value of
_fw_start.
Signed-off-by: Mitchell Horne <mhorne@FreeBSD.org>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
committed by
Anup Patel
parent
f46a5643bc
commit
94197a8c49
@@ -309,8 +309,8 @@ _scratch_init:
|
||||
REG_S a5, SBI_SCRATCH_FW_SIZE_OFFSET(tp)
|
||||
|
||||
/* Store R/W section's offset in scratch space */
|
||||
lla a4, __fw_rw_offset
|
||||
REG_L a5, 0(a4)
|
||||
lla a5, _fw_rw_start
|
||||
sub a5, a5, a4
|
||||
REG_S a5, SBI_SCRATCH_FW_RW_OFFSET(tp)
|
||||
|
||||
/* Store fw_heap_offset and fw_heap_size in scratch space */
|
||||
@@ -536,8 +536,6 @@ _link_start:
|
||||
RISCV_PTR FW_TEXT_START
|
||||
_link_end:
|
||||
RISCV_PTR _fw_reloc_end
|
||||
__fw_rw_offset:
|
||||
RISCV_PTR _fw_rw_start - _fw_start
|
||||
|
||||
.section .entry, "ax", %progbits
|
||||
.align 3
|
||||
|
||||
Reference in New Issue
Block a user