summaryrefslogtreecommitdiffstats
path: root/arch/riscv/lib/reloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv/lib/reloc.c')
-rw-r--r--arch/riscv/lib/reloc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/riscv/lib/reloc.c b/arch/riscv/lib/reloc.c
index da53c50448..0c1ec8b488 100644
--- a/arch/riscv/lib/reloc.c
+++ b/arch/riscv/lib/reloc.c
@@ -42,9 +42,13 @@ void relocate_to_current_adr(void)
if (!offset)
return;
- dstart = __rel_dyn_start + offset;
- dend = __rel_dyn_end + offset;
- dynsym = (void *)__dynsym_start + offset;
+ /*
+ * We have yet to relocate, so using runtime_address
+ * to compute the relocated address
+ */
+ dstart = runtime_address(__rel_dyn_start);
+ dend = runtime_address(__rel_dyn_end);
+ dynsym = runtime_address(__dynsym_start);
for (rela = dstart; (void *)rela < dend; rela++) {
unsigned long *fixup;
@@ -66,7 +70,7 @@ void relocate_to_current_adr(void)
putc_ll(' ');
puthex_ll(rela->r_addend);
putc_ll('\n');
- panic("");
+ __hang();
}
}