From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lCvpQ-0006Qy-3J for mharc-grub-devel@gnu.org; Thu, 18 Feb 2021 21:47:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCvpN-0006OL-T4 for grub-devel@gnu.org; Thu, 18 Feb 2021 21:47:34 -0500 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]:42431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCvpK-00009V-EW for grub-devel@gnu.org; Thu, 18 Feb 2021 21:47:33 -0500 Received: by mail-qv1-xf36.google.com with SMTP id s10so1373044qvl.9 for ; Thu, 18 Feb 2021 18:47:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IUOwMPCY1Vajwze4J8Ec3ysh35fWT5hE3/2zAFDDmYc=; b=M0GJcx8Dmn/436HtLpArDA4XsVXrcm09rB0lQFqnXMhRBg3zZA6ZB6hHAinEQ0kKQt FR9MNi8nhL12Z5UhVqCtAnvdHZcLmHAEZju+RuztkOdDZezFseIOOI6qzklz9OIqvJ4x DYgP5x7NJrgHEi/GtnuQUm0gfTxLqJbHhpDM1oLuxud8d4kIG2Ev5Jnr0fbjOdR60a74 o1N38r1gkM7M7V9ddZwWuX0YuSvVTkrgr10XDW/XVhdF3XGQaJVy9xhc+hLSVUgNtOSH 0stIKfugjuzmRsDTwGI0eGVPzqhHABk5gkAhKP8Z/Jd+GH/nXS8ANLF+DsjFQT9EH71Z JRWw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=IUOwMPCY1Vajwze4J8Ec3ysh35fWT5hE3/2zAFDDmYc=; b=BDTtLp0vlyVjcoxp6ILuVweG1azMV+PhwLfPYplQpE3RzxWoRQ5xbuwUI3654U05+X YfAWTc6iQ55DD469Bld1u1Fln/X+9uMCtRfUZY/LSRPMmnzUe2US06WWlc4Ql5mU8Y7y m0nZbGWCdBAMjFXeM7+pH7EYEpPalCouhNYRErcI87PHuMvopoHSLkcDDtlRVLORJkFO g9o/QdZGLRgt8rOEM0AxW/38gJw75htcQXHmLFY8tluf+9yDugVtoU7U8ik0GxRE3u2/ m7dLyD8empng9oZqdlpBQn4LZBDUaqb3pr3sbgtkc8u6sqLreRqQbZMSpQv/QKfRiMUZ ZEkQ== X-Gm-Message-State: AOAM533N45SK/ZBkwi5RlAdA2Ty7ciCMkO+u5r63VmLI6AwBI/Kne1G1 GJLGuOVn8sZwbktHr4eq5DfhExSVVjscVQ== X-Google-Smtp-Source: ABdhPJydHDogTiySzMFJTUpfbVpIkeYCk9vJ1kDIWcukd75+NUaYkoqmBxnmDREh58CGtjOYvqSrsw== X-Received: by 2002:a05:6214:2b06:: with SMTP id jx6mr3554192qvb.48.1613702848143; Thu, 18 Feb 2021 18:47:28 -0800 (PST) Received: from localhost.localdomain ([2605:a601:aac5:3700:c323:c101:d96b:34f1]) by smtp.gmail.com with ESMTPSA id y2sm5341515qkj.56.2021.02.18.18.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Feb 2021 18:47:27 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org Cc: Daniel Kiper , Glenn Washburn Subject: [PATCH v4 10/13] error: Use format code PRIxGRUB_UINT64_T for 64-bit arg in grub_error Date: Thu, 18 Feb 2021 20:47:11 -0600 Message-Id: X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::f36; envelope-from=development@efficientek.com; helo=mail-qv1-xf36.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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: , X-List-Received-Date: Fri, 19 Feb 2021 02:47:34 -0000 The macro ELF_R_TYPE does not change the underlying type. Here its argument is a 64-bit Elf64_Xword. Make sure the format code matches. For the riscv architecture, rel->r_info could be either Elf32_Xword or Elf64_Xword depending on if 32 or 64-bit risc is being built. So cast to 64-bit value regardless. Signed-off-by: Glenn Washburn --- grub-core/efiemu/i386/loadcore64.c | 3 ++- grub-core/kern/arm64/dl.c | 3 ++- grub-core/kern/ia64/dl.c | 3 ++- grub-core/kern/riscv/dl.c | 5 +++-- grub-core/kern/sparc64/dl.c | 3 ++- grub-core/kern/x86_64/dl.c | 3 ++- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/grub-core/efiemu/i386/loadcore64.c b/grub-core/efiemu/i386/loadcore64.c index 18facf47f..3e9a71cfd 100644 --- a/grub-core/efiemu/i386/loadcore64.c +++ b/grub-core/efiemu/i386/loadcore64.c @@ -122,7 +122,8 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, break; default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - N_("relocation 0x%x is not implemented yet"), + N_("relocation 0x%"PRIxGRUB_UINT64_T + " is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } diff --git a/grub-core/kern/arm64/dl.c b/grub-core/kern/arm64/dl.c index fb0337319..b04fed18a 100644 --- a/grub-core/kern/arm64/dl.c +++ b/grub-core/kern/arm64/dl.c @@ -184,7 +184,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - N_("relocation 0x%x is not implemented yet"), + N_("relocation 0x%"PRIxGRUB_UINT64_T + " is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } diff --git a/grub-core/kern/ia64/dl.c b/grub-core/kern/ia64/dl.c index ebcf31629..ddf240976 100644 --- a/grub-core/kern/ia64/dl.c +++ b/grub-core/kern/ia64/dl.c @@ -137,7 +137,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, break; default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - N_("relocation 0x%x is not implemented yet"), + N_("relocation 0x%"PRIxGRUB_UINT64_T + " is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } diff --git a/grub-core/kern/riscv/dl.c b/grub-core/kern/riscv/dl.c index 6fb8385ef..77f5b7648 100644 --- a/grub-core/kern/riscv/dl.c +++ b/grub-core/kern/riscv/dl.c @@ -331,8 +331,9 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, break; default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - N_("relocation 0x%x is not implemented yet"), - ELF_R_TYPE (rel->r_info)); + N_("relocation 0x%"PRIxGRUB_UINT64_T + " is not implemented yet"), + (grub_uint64_t)ELF_R_TYPE (rel->r_info)); } } diff --git a/grub-core/kern/sparc64/dl.c b/grub-core/kern/sparc64/dl.c index 739be4717..60ce183fb 100644 --- a/grub-core/kern/sparc64/dl.c +++ b/grub-core/kern/sparc64/dl.c @@ -177,7 +177,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, break; default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - N_("relocation 0x%x is not implemented yet"), + N_("relocation 0x%"PRIxGRUB_UINT64_T + " is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } diff --git a/grub-core/kern/x86_64/dl.c b/grub-core/kern/x86_64/dl.c index 3a73e6e6c..8d2800c9e 100644 --- a/grub-core/kern/x86_64/dl.c +++ b/grub-core/kern/x86_64/dl.c @@ -107,7 +107,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr, default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - N_("relocation 0x%x is not implemented yet"), + N_("relocation 0x%"PRIxGRUB_UINT64_T + " is not implemented yet"), ELF_R_TYPE (rel->r_info)); } } -- 2.27.0