All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: grub-devel@gnu.org
Cc: Khem Raj <raj.khem@gmail.com>, Andreas Schwab <schwab@suse.de>,
	Daniel Kiper <daniel.kiper@oracle.com>,
	Chester Lin <clin@suse.com>, Nikita Ermakov <arei@altlinux.org>,
	Alistair Francis <alistair.francis@wdc.com>
Subject: [PATCH] RISC-V: Restore the typcast to 64bit type
Date: Sun, 28 Mar 2021 15:49:13 -0700	[thread overview]
Message-ID: <20210328224913.799167-1-raj.khem@gmail.com> (raw)

this makes the type promotions clear and explicit
It was already typecasted to long but was accidentally dropped in [1]
which stated to cause failures on riscv32 as reported in [2]

[1] https://git.savannah.gnu.org/cgit/grub.git/commit/?id=2bf40e9e5be9808b17852e688eead87acff14420
[2] https://savannah.gnu.org/bugs/index.php?60283

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Andreas Schwab <schwab@suse.de>
Cc: Daniel Kiper <daniel.kiper@oracle.com>
Cc: Chester Lin <clin@suse.com>
Cc: Nikita Ermakov <arei@altlinux.org>
Cc: Alistair Francis <alistair.francis@wdc.com>
---
 util/grub-mkimagexx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/grub-mkimagexx.c b/util/grub-mkimagexx.c
index 00f49ccaa..ac677d03d 100644
--- a/util/grub-mkimagexx.c
+++ b/util/grub-mkimagexx.c
@@ -1242,7 +1242,7 @@ SUFFIX (relocate_addrs) (Elf_Ehdr *e, struct section_metadata *smd,
 		  */
 
 		 sym_addr += addend;
-		 off = sym_addr - target_section_addr - offset - image_target->vaddr_offset;
+		 off = (grub_int64_t)sym_addr - target_section_addr - offset - image_target->vaddr_offset;
 
 		 switch (ELF_R_TYPE (info))
 		   {
-- 
2.31.1



             reply	other threads:[~2021-03-28 22:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-28 22:49 Khem Raj [this message]
2021-03-29 10:24 ` [PATCH] RISC-V: Restore the typcast to 64bit type Andreas Schwab
2021-03-29 18:33   ` Khem Raj
2021-03-29 22:29     ` Daniel Kiper
2021-04-12 13:07       ` Daniel Kiper
  -- strict thread matches above, loose matches on Subject: below --
2021-03-28 22:45 Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210328224913.799167-1-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=alistair.francis@wdc.com \
    --cc=arei@altlinux.org \
    --cc=clin@suse.com \
    --cc=daniel.kiper@oracle.com \
    --cc=grub-devel@gnu.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.