public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Richard W.M. Jones" <rjones@redhat.com>
To: binutils@sourceware.org
Subject: Re: [PATCH] binutils/windmc: Parse input correctly on big endian hosts
Date: Wed, 24 Jan 2024 11:55:18 +0000	[thread overview]
Message-ID: <20240124115518.GS7636@redhat.com> (raw)
In-Reply-To: <20240124112014.2675193-1-rjones@redhat.com>

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


      reply	other threads:[~2024-01-24 11:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-24 11:20 Richard W.M. Jones
2024-01-24 11:55 ` Richard W.M. Jones [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240124115518.GS7636@redhat.com \
    --to=rjones@redhat.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).