From patchwork Sat Oct 7 22:01:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 149652 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1117458vqo; Sat, 7 Oct 2023 15:01:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEWtnP0w4kmG6NtSSXjzddzGU//mQd2UydBcRAJ/KrmpzD2WSpb/13a9BRC2bifaRJDHZiK X-Received: by 2002:a17:906:530b:b0:9b2:b975:8327 with SMTP id h11-20020a170906530b00b009b2b9758327mr11843126ejo.65.1696716104626; Sat, 07 Oct 2023 15:01:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696716104; cv=none; d=google.com; s=arc-20160816; b=CCkSuCMwdgXqEz0LmNUgFau0BXlCdOpwJUSvtrkuxcEmvwbu6Nm7YyA4hpOjnjjb1T wCbIdM3gTX3soY6+M3rNH2vk2IQDfWIVO0rje4+N/ho7K7Oe/2Krns32zLGeZnJivUou fDEuAbK0nIwea7sa7O/v6rz+uTjdbxlCvIRtZ5yYfBKYrkLy6E94R8+5DLpvelSHKCes glgsF0v6V8FkPWblpsTNKm6iebLXwHCMxGGMZ4U5aZWFUSbhO3iJf24cDe+bxSmOm+bA Sji4k2GxbGcElCg3wjaJ54V67rUBH/5ZKO7Zf5uj+OhLx31EHaifq+AdPZbGwBPudQj6 jH2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dmarc-filter:delivered-to; bh=aEodPzJF/ByqX76FIbesUoxjY9t0zRA+qf06Qjm5t9o=; fh=EIaO7b7ALeDal5H1/am9aYq9dhBqX8jnZRxAv1hbs2k=; b=a+YizrKh/a0LUGjnZqm19GaVdQAH26gblYrdwmXDVBNdMuPEUMlsmAF+3RAe3vlypT pkkQ5ZladHtqk64U/pARS27/PNXzFMKkcpK1o6rccii0Z8MPAN/gmdUjGZ7qexG28UF6 Tp1fIew5kSfQsTxUDzZe9P0K6mhCiUo0HLvsBdRwcj8Szbj1bLSzEjbqr094gluufw1y LI/xVPO7YbQEKbdVREIw1crgimp0CxSDNjrOVhYcF4DUruGQ+WoFDG3DIsDwl3Wt4PIe DdXrcCAw9Ah5hMGPK+mw5Fa3O444Q7zxuX2YCUxBy2ERf1mqsMduDoM5PjT+QeqZ+NFS Rbdg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id cb6-20020a170906a44600b0099cd1c0cb1dsi2848927ejb.388.2023.10.07.15.01.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 15:01:44 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B9D3E3856DD6 for ; Sat, 7 Oct 2023 22:01:41 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 5C1E03858C53 for ; Sat, 7 Oct 2023 22:01:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5C1E03858C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from csb.redhat.com (deer0x03.wildebeest.org [172.31.17.133]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 3685130067AE; Sun, 8 Oct 2023 00:01:35 +0200 (CEST) Received: by csb.redhat.com (Postfix, from userid 10916) id 09ED7D0B90; Sun, 8 Oct 2023 00:01:35 +0200 (CEST) From: Mark Wielaard To: eager@eagercon.com Cc: appa.rao.nali@amd.com, binutils@sourceware.org, ibai.erkiaga-elorza@amd.com, luca.ceresoli@bootlin.com, mark.hatle@amd.com, nagaraju.mekala@amd.com, neal.frager@amd.com, nickc@redhat.com, sadanand.mutyala@amd.com, vidhumouli.hunsigida@amd.com, Mark Wielaard Subject: [PATCH] microblaze: fix build error on 32-bit hosts Date: Sun, 8 Oct 2023 00:01:05 +0200 Message-Id: <20231007220105.818599-1-mark@klomp.org> X-Mailer: git-send-email 2.39.3 In-Reply-To: <5d2ce973-6287-db3d-fc82-966914f765a7@eagercon.com> References: <5d2ce973-6287-db3d-fc82-966914f765a7@eagercon.com> MIME-Version: 1.0 X-Spam-Status: No, score=-3034.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779135786058675659 X-GMAIL-MSGID: 1779135786058675659 commit 6bbf24955 opcodes: microblaze: Add new bit-field instructions introduced a build error on 32-bit hosts: elf32-microblaze.c: In function ‘microblaze_elf_relax_section’: elf32-microblaze.c:1989:53: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘bfd_vma’ {aka ‘unsigned int’} [-Werror=format=] 1989 | fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend); | ~~^ ~~~~~~~~~~~~~~ | | | | long unsigned int bfd_vma {aka unsigned int} | %x elf32-microblaze.c:2074:51: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘bfd_vma’ {aka ‘unsigned int’} [-Werror=format=] 2074 | fprintf(stderr, "%d: CORRUPT relax reloc! %x %lx\n", __LINE__, val, irelscan->r_addend); | ~~^ ~~~~~~~~~~~~~~~~~~ | | | | long unsigned int bfd_vma {aka unsigned int} | %x Fix by explicitly casting the r_addend to long. --- bfd/elf32-microblaze.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bfd/elf32-microblaze.c b/bfd/elf32-microblaze.c index a8ced43c08a..2c584f91a4e 100644 --- a/bfd/elf32-microblaze.c +++ b/bfd/elf32-microblaze.c @@ -1986,7 +1986,7 @@ microblaze_elf_relax_section (bfd *abfd, /* Validate the in-band val. */ val = bfd_get_32 (abfd, contents + irel->r_offset); if (val != irel->r_addend && ELF32_R_TYPE (irel->r_info) == R_MICROBLAZE_32_NONE) { - fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, irel->r_addend); + fprintf(stderr, "%d: CORRUPT relax reloc %x %lx\n", __LINE__, val, (long) irel->r_addend); } irel->r_addend -= (efix - sfix); /* Should use HOWTO. */ @@ -2071,7 +2071,7 @@ microblaze_elf_relax_section (bfd *abfd, val = bfd_get_32 (abfd, ocontents + irelscan->r_offset); if (val != irelscan->r_addend) { - fprintf(stderr, "%d: CORRUPT relax reloc! %x %lx\n", __LINE__, val, irelscan->r_addend); + fprintf(stderr, "%d: CORRUPT relax reloc! %x %lx\n", __LINE__, val, (long) irelscan->r_addend); } irelscan->r_addend -= calc_fixup (irelscan->r_addend, 0, sec);