[PATCH] binutils/windmc: Parse input correctly on big endian hosts

Richard W.M. Jones rjones@redhat.com
Wed Jan 24 11:55:18 GMT 2024


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



More information about the Binutils mailing list