From patchwork Sun Mar 28 22:49:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 410611 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3174017jai; Sun, 28 Mar 2021 15:49:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx73EA7IKTcup0QNfw2+3hM1x6hhnJ8zl29RbKN94do+RuojAWBb0ARPb8ri7KhICyvsWwi X-Received: by 2002:a92:d68e:: with SMTP id p14mr15721607iln.0.1616971765436; Sun, 28 Mar 2021 15:49:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616971765; cv=none; d=google.com; s=arc-20160816; b=hU22VKBTJ7cbQiApXkemuQ3T/Q18kdUpN2MZkCblDDMPWXY03aBmDUkTB4sHNDTGze DAbaXGfN+lqzC27M+z5lJlSEVAtNF9pT1PlQZi9tkZd/LZ3eUBVxqLin4IN2S4QqsjIC TjnodEDLgjUqr5fViMc7gMdW7MwE3dQNMJ+dWm6OafCxWPpVbe1rk2lc1yitR03ZhBl9 dzjscL0Ndxohuhc1XMZKCOisEo8G2JGx8iDQOahWFoD/+6dcZduXX/06c81oMPXBSqTy UgL004JpISULECFLUEnwsUGFD1IatqTESfmD7jV8Bzb9vNckr4IPBZblQ+H3Cn1u43eF naZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=/D4RAqTpM2xIZBjlh3r0fwQjKjQ0/uqikEn86DqSquk=; b=uVAoNz/CkNfTI1UYghbBVttQ26toRL3VX9zPqPM5OMJVPXI+JFcQSz1pbPM1IBEor/ waDjRN7wvVUEhRZsQppIlgQiUskNTyZ4Yh31O0eDds4zS2BRGS+FwUey3DN+hkLpeJsx lBY3yz7ZCfT/TCn/82w7lJCSqMbtePrNGPeizulDOfcfJ23hU9NLC4f2oGs4uPCQc4gT Dr8g6Obxyr5cQ73y8P70JG/I+BkzW/eFofnczxLMd5JWJ8QrMbEoqDkAWDh4fkA8+bii RuCtDWmoFAAEleG6K6Szl6QEu/vUxY0DdpDCqy2njElv+5TGOCmcRc8QrIF+QZKFfl4P Wh4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=LwmbJND5; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l3si5580748ilv.80.2021.03.28.15.49.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Mar 2021 15:49:25 -0700 (PDT) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=LwmbJND5; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from localhost ([::1]:42088 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQeDk-0000ru-UE for patch@linaro.org; Sun, 28 Mar 2021 18:49:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60182) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQeDg-0000rn-Up for grub-devel@gnu.org; Sun, 28 Mar 2021 18:49:20 -0400 Received: from mail-pj1-x102c.google.com ([2607:f8b0:4864:20::102c]:35513) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lQeDf-0001rq-At for grub-devel@gnu.org; Sun, 28 Mar 2021 18:49:20 -0400 Received: by mail-pj1-x102c.google.com with SMTP id il9-20020a17090b1649b0290114bcb0d6c2so6825846pjb.0 for ; Sun, 28 Mar 2021 15:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8ZKbzwJyorTEsOHijlmJFJYfRDFtSUtgVxSZz1AVHgQ=; b=LwmbJND58glbtQJ5XubtLJC0e+BjYjuSHy09Z+uxAM1kIzRpDwshYWcYsZDleWe44Z 1/dHuGl4kDPCsZ9XwjalaJPC3g+ccqq0GaLrMbXpderjrrbsIkTLTwz11vKzVUgZxfkn CTqLelxr7tTy6/YCcduVvUL2a0tdBZQT+QEpepzRGC+lTEI0Fd6egjlKrEKct3+JH9Tk 4tMSW3zI4whiReH6LQvg3vTk8sqstMAFf/oBve+seinfHC7MUoZeV+m2cYvY+DDtQZ5X aMSLpqhrmeIc8rFE7glgALqVcBfeqfOAUmypzHJDlk5TSOHl2oqGMXHxNFXwNjmSmKqi qxHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8ZKbzwJyorTEsOHijlmJFJYfRDFtSUtgVxSZz1AVHgQ=; b=cEbQgqnkWM4/tkmpVtzmp6YpqjvBjmDtHF4aht0jOwnHTUWskg0xerrbKRXYfDtyq0 Bp390oNODsQq4AeFYxKQn03jYpIEMrXZTJff6qcqm/di1CW0x60GiKPU1ZQPdBdVFEV0 Y/gdD6Gvw/3Pus/VyrswFpULLj47ZxnIfP1W6gS470TRmajTzGgeQxp8RLOD2VtyIoId GlAZz3vDkOO8x1RTB4lWdxnHn3mvgGinnSG3nP0JkM0+K3DijpTiIH9ALDm89aQfDMKU OMcMd+6yoEbGe8SefWgE8UdIBQGSuTYBlZYmxhpACr2DaGeaMJxQNpevFOZkHqnL6Q4D VtRg== X-Gm-Message-State: AOAM530RrURvZqs0QiEwj333jfF85mBitk7YFfyUHRVHoiHm/1AhuWjP Sp0ntGrkGL0gsqDVmvuY8NkscNxeUGiHhA== X-Received: by 2002:a17:90b:515:: with SMTP id r21mr23434115pjz.42.1616971757607; Sun, 28 Mar 2021 15:49:17 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9200:a0f0::ae20]) by smtp.gmail.com with ESMTPSA id 76sm15729734pfw.156.2021.03.28.15.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Mar 2021 15:49:17 -0700 (PDT) From: Khem Raj To: grub-devel@gnu.org Cc: Khem Raj , Andreas Schwab , Daniel Kiper , Chester Lin , Nikita Ermakov , Alistair Francis Subject: [PATCH] RISC-V: Restore the typcast to 64bit type Date: Sun, 28 Mar 2021 15:49:13 -0700 Message-Id: <20210328224913.799167-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102c; envelope-from=raj.khem@gmail.com; helo=mail-pj1-x102c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" 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 Cc: Andreas Schwab Cc: Daniel Kiper Cc: Chester Lin Cc: Nikita Ermakov Cc: Alistair Francis --- 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)) {