* PR25637, objcopy : SIGSEGV in copy_object
@ 2020-03-06 0:07 Alan Modra
0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2020-03-06 0:07 UTC (permalink / raw)
To: binutils
PR 25637
* objcopy.c (filter_symbols): Correct rem_leading_char logic.
diff --git a/binutils/objcopy.c b/binutils/objcopy.c
index 3b9f1b73ca..16affa9960 100644
--- a/binutils/objcopy.c
+++ b/binutils/objcopy.c
@@ -1549,12 +1549,13 @@ filter_symbols (bfd *abfd, bfd *obfd, asymbol **osyms,
/* Check if we will remove the current leading character. */
rem_leading_char =
- (name[0] == bfd_get_symbol_leading_char (abfd))
- && (change_leading_char
- || (remove_leading_char
- && ((flags & (BSF_GLOBAL | BSF_WEAK)) != 0
- || undefined
- || bfd_is_com_section (bfd_asymbol_section (sym)))));
+ (name[0] != '\0'
+ && name[0] == bfd_get_symbol_leading_char (abfd)
+ && (change_leading_char
+ || (remove_leading_char
+ && ((flags & (BSF_GLOBAL | BSF_WEAK)) != 0
+ || undefined
+ || bfd_is_com_section (bfd_asymbol_section (sym))))));
/* Check if we will add a new leading character. */
add_leading_char =
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-03-06 0:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-06 0:07 PR25637, objcopy : SIGSEGV in copy_object Alan Modra
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).