Andrew Geissler | 95ac1b8 | 2021-03-31 14:34:31 -0500 | [diff] [blame^] | 1 | From e4c41db74b8972285cbdfe614c95c1ffd97d70e1 Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Fri, 26 Mar 2021 11:59:43 -0700 |
| 4 | Subject: [PATCH] RISC-V: Restore the typcast to 64bit type |
| 5 | |
| 6 | this makes the type promotions clear and explicit |
| 7 | It was already typecasted to long but was accidentally dropped in [1] |
| 8 | which stated to cause failures on riscv32 as reported in [2] |
| 9 | |
| 10 | [1] https://git.savannah.gnu.org/cgit/grub.git/commit/?id=2bf40e9e5be9808b17852e688eead87acff14420 |
| 11 | [2] https://savannah.gnu.org/bugs/index.php?60283 |
| 12 | |
| 13 | Upstream-Status: Submitted |
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 15 | Cc: Andreas Schwab <schwab@suse.de> |
| 16 | Cc: Daniel Kiper <daniel.kiper@oracle.com> |
| 17 | Cc: Chester Lin <clin@suse.com> |
| 18 | Cc: Nikita Ermakov <arei@altlinux.org> |
| 19 | Cc: Alistair Francis <alistair.francis@wdc.com> |
| 20 | --- |
| 21 | util/grub-mkimagexx.c | 2 +- |
| 22 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 23 | |
| 24 | diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c |
| 25 | index 00f49ccaa..ac677d03d 100644 |
| 26 | --- a/util/grub-mkimagexx.c |
| 27 | +++ b/util/grub-mkimagexx.c |
| 28 | @@ -1242,7 +1242,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd, |
| 29 | */ |
| 30 | |
| 31 | sym_addr += addend; |
| 32 | - off = sym_addr - target_section_addr - offset - image_target->vaddr_offset; |
| 33 | + off = (grub_int64_t)sym_addr - target_section_addr - offset - image_target->vaddr_offset; |
| 34 | |
| 35 | switch (ELF_R_TYPE (info)) |
| 36 | { |
| 37 | -- |
| 38 | 2.31.1 |
| 39 | |