public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Jan Beulich <jbeulich@suse.com>, Binutils <binutils@sourceware.org>
Cc: Alan Modra <amodra@gmail.com>
Subject: Re: how to know host endianness in binutils
Date: Tue, 2 Jan 2024 11:29:15 +0000	[thread overview]
Message-ID: <0ffc918c-0866-41a1-b3f5-6b5183d75c74@redhat.com> (raw)
In-Reply-To: <d4fe56ce-d6b8-4003-a2ff-f899562440fa@suse.com>

Hi Jan,

> looking around, I can't seem to be able to find any standardized way of
> knowing host endianness in binutils (in gas/ in particular).

There is a CYG_AC_C_ENDIAN function in config/acinclude.m4 that defines
LITTLE_ENDIAN_HOST for little endian hosts, but as far as I can tell this
function is never invoked.

> 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.

Other code seems to rely upon this define too.  For example gdb/tracectf.c.

Also as H.J. mentioned it does appear that the code in the script configure
does do the right thing.  I would suggest that you can safely use it.

Cheers
   Nick





  parent reply	other threads:[~2024-01-02 11:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-21 14:30 Jan Beulich
2023-12-21 15:11 ` H.J. Lu
2024-01-02 11:29 ` Nick Clifton [this message]
2024-01-09 16:19 ` Michael Matz

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=0ffc918c-0866-41a1-b3f5-6b5183d75c74@redhat.com \
    --to=nickc@redhat.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    /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).