public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>,
	Andrew Waterman <andrew@sifive.com>,
	Jim Wilson <jim.wilson.gcc@gmail.com>,
	Nelson Chu <nelson@rivosinc.com>,
	Binutils <binutils@sourceware.org>, Alan Modra <amodra@gmail.com>
Subject: Re: [PATCH RFC] RISC-V: alter the special character used in FAKE_LABEL_NAME
Date: Wed, 15 Mar 2023 11:08:32 +0000	[thread overview]
Message-ID: <ac073129-0d65-29c5-a82c-dc5839335551@redhat.com> (raw)
In-Reply-To: <67df1a4d-223f-2b4c-4957-394a299fb112@suse.com>

Hi Jan,

> I wonder therefore whether S_IS_LOCAL() and S_IS_EXTERNAL() can't be made
> true opposites of one another (with perhaps one of the two simply expanding
> to a call to the other, inverting the result).

I think that they are actually testing different things.  The way I see it,
S_IS_LOCAL() should return true for any symbol that is not intended to be
seen by anyone disassembling the code.  (Unless of course a command line
has been used to change this behaviour).  So for example labels like .L1
or ^B1.   This does not however mean the same thing as ELF's STB_LOCAL
binding.  Local ELF symbols can be found in disassemblies, should be present
in symbol tables, and represent something intelligible to the user, rather
than something invented by the assembler.

S_IS_EXTERNAL() on the other hand is meant to return true for symbols which
are not only exposed to the disassembler, but which also have visibility
outside of the file which is currently being assembled.  ie in ELF terms
symbols which have a binding other than STB_LOCAL.

That is why, IMHO, the two functions are different.

Cheers
   Nick


  reply	other threads:[~2023-03-15 11:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10  9:36 Jan Beulich
2023-03-10  9:40 ` Jan Beulich
2023-03-13 12:06   ` Nick Clifton
2023-03-13 12:52     ` Jan Beulich
2023-03-13 14:25       ` Nick Clifton
2023-03-13 15:57         ` Jan Beulich
2023-03-15 11:08           ` Nick Clifton [this message]
2023-03-15 15:45             ` Jan Beulich
2023-03-15 16:05 ` Palmer Dabbelt
2023-03-16 10:35   ` Jan Beulich
2023-03-30 12:01 ` Jan Beulich
2023-08-04 12:04   ` Jan Beulich

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=ac073129-0d65-29c5-a82c-dc5839335551@redhat.com \
    --to=nickc@redhat.com \
    --cc=amodra@gmail.com \
    --cc=andrew@sifive.com \
    --cc=binutils@sourceware.org \
    --cc=jbeulich@suse.com \
    --cc=jim.wilson.gcc@gmail.com \
    --cc=nelson@rivosinc.com \
    --cc=palmer@dabbelt.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).