]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
grub-mkimagexx: Fix RISCV error message
authorVladimir Serbinenko <phcoder@gmail.com>
Fri, 22 Mar 2019 16:11:14 +0000 (17:11 +0100)
committerVladimir Serbinenko <phcoder@google.com>
Mon, 25 Mar 2019 14:11:09 +0000 (15:11 +0100)
Outputting a raw pointer doesn't match the format and is
also useless. Output offset instead.

Signed-off-by: Vladimir Serbinenko <phcoder@google.com>
util/grub-mkimagexx.c

index c04f17d4e498e685dce8261dd9bcb131caf9973e..a79034e7b576d83af62725740322fe69ea274f6d 100644 (file)
@@ -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);