aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2023-08-18 08:57:34 +0200
committerJan Beulich <jbeulich@suse.com>2023-08-18 08:57:34 +0200
commitb41ef0baac449de58c84d1a0261af0d91443b540 (patch)
tree40b4cb3c5857b5e5e2c598b3800f9b36976ef1f7
parent899748950c12ee446bb394bb9660da1034bfbdc9 (diff)
downloadgdb-b41ef0baac449de58c84d1a0261af0d91443b540.zip
gdb-b41ef0baac449de58c84d1a0261af0d91443b540.tar.gz
gdb-b41ef0baac449de58c84d1a0261af0d91443b540.tar.bz2
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.
-rw-r--r--gas/symbols.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gas/symbols.c b/gas/symbols.c
index ea05801..45e46ed 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. */