From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zm-mta-out-3.u-ga.fr (zm-mta-out-3.u-ga.fr [152.77.200.56]) by sourceware.org (Postfix) with ESMTPS id E70E83858D39 for ; Tue, 4 Oct 2022 20:03:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E70E83858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=univ-grenoble-alpes.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=univ-grenoble-alpes.fr Received: from mailhub.u-ga.fr (mailhub-1.u-ga.fr [129.88.178.98]) by zm-mta-out-3.u-ga.fr (Postfix) with ESMTP id 86637403B2 for ; Tue, 4 Oct 2022 22:03:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=univ-grenoble-alpes.fr; s=2020; t=1664913809; bh=UHzyAd5tMIgU6tq2E6okc6YlwkuEXVSpwJsXpjxhOk4=; h=Date:From:To:Subject:From; b=vumY6/wG2GuT0M794zVoUXiqqwhVQdMA8Q7EvSnlnh827XgjWa3/JYuphPOvMCV5l 2QUZBXyjQf0IvWcGPunWCcLDdnBnVJcNgTRwWgb6RBdj5715w/90DVg7HNUZpjuO32 rVAg6QlbeSgloWBV5ssWcvaPpeUmVA1QTbin7zPTMBM02k5uYu1gw3Bmf4i6P3DyMR CvMitco/Yve+7ZvV8MMpV7t+boXe9Tzok+WmUNLUCYNjQUHY4/bWwqxKJzawRwx882 jO8g6rNTKUNiVVNmosEZ8GaPci3Vp5cxOKo2KczKAT4qU19ovDZgzAxZg/FGd1Lmah iswsuXMPc+3lg== Received: from smtps.univ-grenoble-alpes.fr (smtps3.u-ga.fr [195.83.24.62]) by mailhub.u-ga.fr (Postfix) with ESMTP id 83EDC100056 for ; Tue, 4 Oct 2022 22:03:29 +0200 (CEST) Received: from [192.168.1.62] (35.201.90.79.rev.sfr.net [79.90.201.35]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: petrotf@univ-grenoble-alpes.fr) by smtps.univ-grenoble-alpes.fr (Postfix) with ESMTPSA id 7AF794005E for ; Tue, 4 Oct 2022 22:03:29 +0200 (CEST) Message-ID: <5f482299-6c60-b2b3-9abe-f4a55a5a26c5@univ-grenoble-alpes.fr> Date: Tue, 4 Oct 2022 22:03:20 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Content-Language: fr, en-US From: =?UTF-8?B?RnLDqWTDqXJpYyBQw6l0cm90?= To: binutils@sourceware.org Subject: [RFC PATCH] bfd: use bfd_vma for the 64-bit version of put[lb] and get[lb] Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Whitelist-UGA SMTP Authentifie (petrotf@univ-grenoble-alpes.fr) via submission-587 ACL (41) X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_ASCII_DIVIDERS,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 List-Id: Hi, During summer (around Aug.4) Alan replaced in many places the use of bfd_vma and such by the c99 types. However, when compiling for an ad-hoc target of ours, the fact that the 64-bit version of the put and get functions does not share the same prototypes as the other bit-width versions needs a patch while making the prototypes consistent might be acceptable, what do you think? Thanks, Frédéric The 16-bit, 24-bit and 32-bit versions of these functions use an argument of type bfd_[signed_]vma while the 64-bit version uses [u]int64_t. Given the comment in front of the definition of the bfd vma types in bfd-in.h, the use of the bfd specific types should be possible and would make the code consistent across all function versions. bfd/ * bfd-in.h: change argument or return value types in put/get functions prototypes * libbfd.c: likewise for implementations --- bfd/bfd-in.h | 12 ++++++------ bfd/libbfd.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bfd/bfd-in.h b/bfd/bfd-in.h index 4765ea80536..9efb5ce5a84 100644 --- a/bfd/bfd-in.h +++ b/bfd/bfd-in.h @@ -403,10 +403,10 @@ extern bool bfd_record_phdr /* Byte swapping routines. */ -uint64_t bfd_getb64 (const void *); -uint64_t bfd_getl64 (const void *); -int64_t bfd_getb_signed_64 (const void *); -int64_t bfd_getl_signed_64 (const void *); +bfd_vma bfd_getb64 (const void *); +bfd_vma bfd_getl64 (const void *); +bfd_signed_vma bfd_getb_signed_64 (const void *); +bfd_signed_vma bfd_getl_signed_64 (const void *); bfd_vma bfd_getb32 (const void *); bfd_vma bfd_getl32 (const void *); bfd_signed_vma bfd_getb_signed_32 (const void *); @@ -415,8 +415,8 @@ bfd_vma bfd_getb16 (const void *); bfd_vma bfd_getl16 (const void *); bfd_signed_vma bfd_getb_signed_16 (const void *); bfd_signed_vma bfd_getl_signed_16 (const void *); -void bfd_putb64 (uint64_t, void *); -void bfd_putl64 (uint64_t, void *); +void bfd_putb64 (bfd_vma, void *); +void bfd_putl64 (bfd_vma, void *); void bfd_putb32 (bfd_vma, void *); void bfd_putl32 (bfd_vma, void *); void bfd_putb24 (bfd_vma, void *); diff --git a/bfd/libbfd.c b/bfd/libbfd.c index d33f3416206..5eab59d2e76 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -757,7 +757,7 @@ bfd_getl_signed_32 (const void *p) return COERCE32 (v); } -uint64_t +bfd_vma bfd_getb64 (const void *p) { const bfd_byte *addr = (const bfd_byte *) p; @@ -775,7 +775,7 @@ bfd_getb64 (const void *p) return v; } -uint64_t +bfd_vma bfd_getl64 (const void *p) { const bfd_byte *addr = (const bfd_byte *) p; @@ -793,7 +793,7 @@ bfd_getl64 (const void *p) return v; } -int64_t +bfd_signed_vma bfd_getb_signed_64 (const void *p) { const bfd_byte *addr = (const bfd_byte *) p; @@ -811,7 +811,7 @@ bfd_getb_signed_64 (const void *p) return COERCE64 (v); } -int64_t +bfd_signed_vma bfd_getl_signed_64 (const void *p) { const bfd_byte *addr = (const bfd_byte *) p; @@ -850,7 +850,7 @@ bfd_putl32 (bfd_vma data, void *p) } void -bfd_putb64 (uint64_t data, void *p) +bfd_putb64 (bfd_vma data, void *p) { bfd_byte *addr = (bfd_byte *) p; addr[0] = (data >> (7*8)) & 0xff; @@ -864,7 +864,7 @@ bfd_putb64 (uint64_t data, void *p) } void -bfd_putl64 (uint64_t data, void *p) +bfd_putl64 (bfd_vma data, void *p) { bfd_byte *addr = (bfd_byte *) p; addr[7] = (data >> (7*8)) & 0xff; -- 2.30.2 -- +---------------------------------------------------------------------------+ | Frédéric Pétrot, Pr. Grenoble INP-Ensimag/TIMA | | Mob/Pho: +33 6 74 57 99 65/+33 4 76 57 48 70 Ad augusta per angusta | | http://tima.univ-grenoble-alpes.fr frederic.petrot@univ-grenoble-alpes.fr | +---------------------------------------------------------------------------+