From 3562536fd5e5cc3d40942f3e8ac53d4f0ee5c220 Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Fri, 22 Mar 2019 17:11:14 +0100 Subject: [PATCH] grub-mkimagexx: Fix RISCV error message Outputting a raw pointer doesn't match the format and is also useless. Output offset instead. Signed-off-by: Vladimir Serbinenko --- util/grub-mkimagexx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c index c04f17d4e..a79034e7b 100644 --- a/util/grub-mkimagexx.c +++ b/util/grub-mkimagexx.c @@ -1298,7 +1298,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, grub_uint32_t hi20, lo12; if (off != (grub_int32_t)off) - grub_util_error ("target %lx not reachable from pc=%lx", (long)sym_addr, (long)target); + grub_util_error ("target %lx not reachable from pc=%lx", (long)sym_addr, (long)((char *)target - (char *)e)); hi20 = (off + 0x800) & 0xfffff000; lo12 = (off - hi20) & 0xfff; @@ -1337,7 +1337,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, grub_int32_t hi20; if (off != (grub_int32_t)off) - grub_util_error ("target %lx not reachable from pc=%lx", (long)sym_addr, (long)target); + grub_util_error ("target %lx not reachable from pc=%lx", (long)sym_addr, (long)((char *)target - (char *)e)); hi20 = (off + 0x800) & 0xfffff000; *t32 = grub_host_to_target32 ((grub_target_to_host32 (*t32) & 0xfff) | hi20);