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 BEA9D3858D1E for ; Wed, 24 Jan 2024 11:55:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BEA9D3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BEA9D3858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706097322; cv=none; b=bpJkmrZehIpOWJ3yeAeHiOENKCcsxU7ezgWbOfN5/DbW1DpCT7HJ1OlpXHWuqmdv7CUrSywJdLENlGuOEmSHzCZc49ZM8VSs2gl/NNopjcxYelYRct0nkSwFE+MsXUnOrvhRLO6660dr+Ydz9vcT33CniD4/dgpohV2WxTgVvvA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706097322; c=relaxed/simple; bh=/MI1srWZiDOBTVNP2DY55s+xRVKScWq0s7z2eAxknjo=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=S/Bt4ZrlhL/39hbTdAJi+BCd/b7lcA676P3xomsZ9tBP31JNtmhpb7VVD1iX7x47qGZk7+ycSmkoOHLUx9r6fxpq3QW9WHnskMoOf4smUxYGlwd2AD1SnGCAIB2cIspx8Cb3jhz71YrwCVwkHQJyOdQ4Sl02J64I+TA0UDme4Ic= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706097320; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Bzkz0lxeX3xDqAH6LnUOWC0RgyA1kAnlPkS8qDI13Ck=; b=b4ZclIRMq3i/CaWh/MnCTEECMr/F6zN6kHcuIuqAnAudfPzzVYY+oNYhI2cVqvEU+KyJG2 X7pzMy094HpYN3r9pZzbjHPczRdZjhFqjlrh8BPEPyktkYQxcozqa6twPR91qEB1fBYBrd G/xIJMPIpFKp8kZOMsNuxs96Brik10I= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-27-3yVKEfxTMZKbp_LBIptOvg-1; Wed, 24 Jan 2024 06:55:19 -0500 X-MC-Unique: 3yVKEfxTMZKbp_LBIptOvg-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D88D93C0F36C for ; Wed, 24 Jan 2024 11:55:18 +0000 (UTC) Received: from localhost (unknown [10.42.28.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6A6F492BFD for ; Wed, 24 Jan 2024 11:55:18 +0000 (UTC) Date: Wed, 24 Jan 2024 11:55:18 +0000 From: "Richard W.M. Jones" To: binutils@sourceware.org Subject: Re: [PATCH] binutils/windmc: Parse input correctly on big endian hosts Message-ID: <20240124115518.GS7636@redhat.com> References: <20240124112014.2675193-1-rjones@redhat.com> MIME-Version: 1.0 In-Reply-To: <20240124112014.2675193-1-rjones@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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: On Wed, Jan 24, 2024 at 11:20:05AM +0000, Richard W.M. Jones wrote: > +/* Best effort attempt to find out if we're running on a big endian > + * system (only old ppc64 and s390x these days). Assume little endian > + * if the macros are not defined. On big endian, unichar will be a > + * big endian short. > + */ > +#if defined(__BYTE_ORDER__) && \ > + defined(__ORDER_BIG_ENDIAN__) && \ > + __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ > +#define IS_LITTLE_ENDIAN 0 > +#else > +#define IS_LITTLE_ENDIAN 1 > +#endif I just found a thread about how to find host endianness: https://sourceware.org/pipermail/binutils/2024-January/131506.html so I'll rework this patch, except v2 soon. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v