diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-09-30 17:42:47 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-10-05 08:30:39 +0200 |
commit | a8b788ba61eb813f87cc8b401da662a463a9548c (patch) | |
tree | 9545c3256d9712ce5d0c2801f27a32c95a3df5ea /arch/riscv | |
parent | 4ef08098b6d21b20eea76233ede13dc0142e3fab (diff) | |
download | barebox-a8b788ba61eb813f87cc8b401da662a463a9548c.tar.gz barebox-a8b788ba61eb813f87cc8b401da662a463a9548c.tar.xz |
relocate_to_current_adr: hang directly on error instead of panic()
panic() will format a panic message, turn on a panic LED, dump a
stack trace and finally either restart the system or print a
message to ask the user to restart the system before hanging.
When relocation fails, all of these aren't possible, so instead of
devolving into undefined behavior, fall directly into an infinite loop.
Motivation for this change is to avoid linking printf code when it's
only usage is the relocation error case.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220930154247.756577-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/riscv')
-rw-r--r-- | arch/riscv/lib/reloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/lib/reloc.c b/arch/riscv/lib/reloc.c index da53c50448..13118a9ac5 100644 --- a/arch/riscv/lib/reloc.c +++ b/arch/riscv/lib/reloc.c @@ -66,7 +66,7 @@ void relocate_to_current_adr(void) putc_ll(' '); puthex_ll(rela->r_addend); putc_ll('\n'); - panic(""); + __hang(); } } |