public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] gas: make S_IS_LOCAL() and S_IS_EXTERNAL() exclusive of one another
Date: Fri, 18 Aug 2023 06:58:28 +0000 (GMT)	[thread overview]
Message-ID: <20230818065828.C8D413850217@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b41ef0baac449de58c84d1a0261af0d91443b540

commit b41ef0baac449de58c84d1a0261af0d91443b540
Author: Jan Beulich <jbeulich@suse.com>
Date:   Fri Aug 18 08:57:34 2023 +0200

    gas: make S_IS_LOCAL() and S_IS_EXTERNAL() exclusive of one another
    
    While they aren't opposites of each other, there also shouldn't be any
    symbol for which both return true; both may return false. Therefore
    use S_IS_EXTERNAL() in S_IS_LOCAL(), thus subsuming the sanity check
    which so far both did alike.

Diff:
---
 gas/symbols.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/gas/symbols.c b/gas/symbols.c
index ea05801e356..45e46ed39b7 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -2420,15 +2420,14 @@ S_IS_LOCAL (symbolS *s)
   if (s->flags.local_symbol)
     return 1;
 
-  flags = s->bsym->flags;
-
-  /* Sanity check.  */
-  if ((flags & BSF_LOCAL) && (flags & BSF_GLOBAL))
-    abort ();
+  if (S_IS_EXTERNAL (s))
+    return 0;
 
   if (bfd_asymbol_section (s->bsym) == reg_section)
     return 1;
 
+  flags = s->bsym->flags;
+
   if (flag_strip_local_absolute
       /* Keep BSF_FILE symbols in order to allow debuggers to identify
 	 the source file even when the object file is stripped.  */

                 reply	other threads:[~2023-08-18  6:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20230818065828.C8D413850217@sourceware.org \
    --to=jbeulich@sourceware.org \
    --cc=bfd-cvs@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).