how to know host endianness in binutils
Jan Beulich
jbeulich@suse.com
Thu Dec 21 14:30:50 GMT 2023
Hello,
looking around, I can't seem to be able to find any standardized way of
knowing host endianness in binutils (in gas/ in particular). As was
pointed out to me, the new cpu_flags_from_attr() in config/tc-i386.c
won't work as is on big-endian hosts, yet I would really, really like
to avoid needing to enumerate all of the dozens of bitfields in that
function (converting one kind of bitfield to another). That's not the
least because this set constantly grows.
I can see config/tc-bpf.c checking WORDS_BIGENDIAN, but I couldn't
convince myself (from looking at the generated config.h) that one can
really rely on that.
Jan
More information about the Binutils
mailing list