From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lHyFk-0004R9-NP for mharc-grub-devel@gnu.org; Thu, 04 Mar 2021 19:23:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lHyFe-0004NN-8i for grub-devel@gnu.org; Thu, 04 Mar 2021 19:23:31 -0500 Received: from mail-qk1-x72e.google.com ([2607:f8b0:4864:20::72e]:45088) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lHyFS-0006SK-34 for grub-devel@gnu.org; Thu, 04 Mar 2021 19:23:30 -0500 Received: by mail-qk1-x72e.google.com with SMTP id z128so306667qkc.12 for ; Thu, 04 Mar 2021 16:23:16 -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=QrLwWUCzcZqG6/jpYcp6oLxowErg7eiYESh5oMuJMQo=; b=p43YLQmGdaTmL3MiMSHbhSoI6KgTqx+agUFH6FnXqLn9Zoq5gVbryfM/ubc7fUyHy2 Mmwz5ffUUiyhvwr8II87z4+ACsDBXQ3P4vVKqBD1blAXYU1SBppsdgWQkGvujKijm9lk mXa6j135CJ+CVs7d/Ws0SyVFT/HNANZoEJ5q/P4dAyJGwtFC6Sq81HgQcleeBcPlIBvz hhP36VDB9YhuOV5Ho04aXu9PhKQLOSr1p4azjqgRjL3ecGjgFG5iNrIx+vPPAOH+uozl giF+b3pPx3ezWw1Uh6EsvtnDhZVqswdd9kEjmRa8WM5enJJJOKoouULcsOOEuSEzPe3F fbGg== 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=QrLwWUCzcZqG6/jpYcp6oLxowErg7eiYESh5oMuJMQo=; b=gbASxWiT+YnWrKLpsBJfLrQOmHEbGyi5vGoHF+YbAn7OAHmiFV3iQhz8rAqstvoKYh dnvfeOLFKgioB0dqUxUgnNpVjtneBRvqL5B7hiYsfuNAS753Y0Qk7kymtBx7Q7k7Y2lk +P/2HyfsB0f6pFAt/iHKRAWYWYI9t9q2ub1+XGc8N3QQC3cIr4QUwnZDscMLRFEzpgm5 pOUcZcXxRka8/IDn2cIk2aBWbulLhe1ju36Tl/ENjHVei7plFqUEFClmX29xPwyp8r1V Xv693jDyusbHAZSpmha21RtaJCyvz2AHfIQE4wrj1AAgBFuZXwrFPFWDgie8EllvF9VO n91w== X-Gm-Message-State: AOAM533/NFvzNovRq8KYWTfQNCoq8quh2QQpyTi38bck/ZAD+3dQifiE i6t+dsmQ1x5ipqz65Ykk4sE563Ee0m7DaQ== X-Google-Smtp-Source: ABdhPJx4qkj1lbY2Xaz4ZqFG6+0PyqpTVxg3mw3YKVgiM1pewTJfnFGxfA+AbYlX6vHFOoiLenklnA== X-Received: by 2002:a37:7f83:: with SMTP id a125mr6567283qkd.44.1614903796024; Thu, 04 Mar 2021 16:23:16 -0800 (PST) Received: from localhost.localdomain ([2605:a601:aac5:3700:9763:81c2:19e4:8a8f]) by smtp.gmail.com with ESMTPSA id 75sm674558qkd.114.2021.03.04.16.23.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 16:23:15 -0800 (PST) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Glenn Washburn Subject: [PATCH v6 10/14] error: Use format code PRIxGRUB_UINT64_T for 64-bit arg in grub_error Date: Thu, 4 Mar 2021 18:22:41 -0600 Message-Id: <1bfdfa47efafd3396f6ef0998f0115df3b55e1d4.1614903653.git.development@efficientek.com> 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::72e; envelope-from=development@efficientek.com; helo=mail-qk1-x72e.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, 05 Mar 2021 00:23:32 -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..7316efc39 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..401672374 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..b19706c50 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..d78297eee 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..bbcce8ed5 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..1af5a0eeb 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