From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id E22D63858D20 for ; Wed, 31 May 2023 09:21:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E22D63858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685524873; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=4FynlefRtF2Xo0/4cTz+5qiHg0TA3b4dJQeLqfKZttM=; b=KpH6Ncqx+xJ6o0dHJjzOD9s/wBKKsi2PMdRjhoPK7K+TiHJ4YlIpIrpgEwZGfCPYNVHW9D aivUqYpkQLu2gIchvl0CrD8WarGRat40/m7kUDF0LHT41Mc0/1E0qhJPGcUvltR3GBKmQK Pkno3h2qLSfH6huicIIiufgsP618yO0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-131-druIeSDvM8KPQpvt3Rg2Fg-1; Wed, 31 May 2023 05:21:06 -0400 X-MC-Unique: druIeSDvM8KPQpvt3Rg2Fg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AE439858F19 for ; Wed, 31 May 2023 09:21:05 +0000 (UTC) Received: from prancer.redhat.com (unknown [10.42.28.81]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 57E97112132C for ; Wed, 31 May 2023 09:21:05 +0000 (UTC) From: Nick Clifton To: binutils@sourceware.org Subject: Commit: elfxx-loongarch64.c: Fix printf formatting issues. Date: Wed, 31 May 2023 10:21:03 +0100 Message-ID: <87a5xkua9s.fsf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Guys, I am applying the patch below to add some casts to the elfxx-loongarch64.c file where it prints vma values as if they were longs. Whilst this usually works, on a 32-bit host (or a 64-bit host, compiling in 32-bit mode) it produces a compile-time warning about the bfd_vma type not fiting the %lx format specifier. Cheers Nick diff --git a/bfd/elfxx-loongarch.c b/bfd/elfxx-loongarch.c index 9cfbef1431f..ac644fff2f6 100644 --- a/bfd/elfxx-loongarch.c +++ b/bfd/elfxx-loongarch.c @@ -1669,7 +1669,7 @@ reloc_bits_pcrel20_s2 (bfd *abfd, reloc_howto_type *howto, bfd_vma *fix_val) && (val & ((((bfd_signed_vma) 1) << howto->rightshift) - 1))) { (*_bfd_error_handler) (_("%pB: relocation %s right shift %d error 0x%lx"), - abfd, howto->name, howto->rightshift, val); + abfd, howto->name, howto->rightshift, (long) val); bfd_set_error (bfd_error_bad_value); return false; } @@ -1679,7 +1679,7 @@ reloc_bits_pcrel20_s2 (bfd *abfd, reloc_howto_type *howto, bfd_vma *fix_val) if ((val & ~mask) && ((val & ~mask) != ~mask)) { (*_bfd_error_handler) (_("%pB: relocation %s overflow 0x%lx"), - abfd, howto->name, val); + abfd, howto->name, (long) val); bfd_set_error (bfd_error_bad_value); return false; } @@ -1715,7 +1715,7 @@ reloc_bits_b16 (bfd *abfd, reloc_howto_type *howto, bfd_vma *fix_val) if ((val & ~mask) && ((val & ~mask) != ~mask)) { (*_bfd_error_handler) (_("%pB: relocation %s overflow 0x%lx"), - abfd, howto->name, val); + abfd, howto->name, (long) val); bfd_set_error (bfd_error_bad_value); return false; } @@ -1750,7 +1750,7 @@ reloc_bits_b21 (bfd *abfd, reloc_howto_type *howto, bfd_vma *fix_val) if ((val & ~mask) && ((val & ~mask) != ~mask)) { (*_bfd_error_handler) (_("%pB: relocation %s overflow 0x%lx"), - abfd, howto->name, val); + abfd, howto->name, (long) val); bfd_set_error (bfd_error_bad_value); return false; } @@ -1787,7 +1787,7 @@ reloc_bits_b26 (bfd *abfd, reloc_howto_type *howto, bfd_vma *fix_val) if ((val & ~mask) && ((val & ~mask) != ~mask)) { (*_bfd_error_handler) (_("%pB: relocation %s overflow 0x%lx"), - abfd, howto->name, val); + abfd, howto->name, (long) val); bfd_set_error (bfd_error_bad_value); return false; }