From 75cfe082c067db0b12fb982de0833309e454a8e2 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 15 Jun 2020 12:10:06 +0930 Subject: PR26103, Assertion failure with symbols defined in link-once sections PR 26103 * elflink.c (elf_link_add_archive_symbols): Exclude undefined symbols that were defined in discarded sections. * cofflink.c (coff_link_check_archive_element): Likewise. (coff_link_add_symbols): Set indx to -3 for symbols defined in discarded sections. (_bfd_coff_write_global_sym): Don't emit such symbols. libcoff-in.h (struct coff_link_hash_entry): Update indx comment. libcoff.h: Regenerate. --- bfd/libcoff.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bfd/libcoff.h') diff --git a/bfd/libcoff.h b/bfd/libcoff.h index d7e0548..df32c86 100644 --- a/bfd/libcoff.h +++ b/bfd/libcoff.h @@ -247,8 +247,9 @@ struct coff_link_hash_entry { struct bfd_link_hash_entry root; - /* Symbol index in output file. Set to -1 initially. Set to -2 if - there is a reloc against this symbol. */ + /* Symbol index in output file. This is initialized to -1. It is + set to -2 if the symbol is used by a reloc. It is set to -3 if + this symbol is defined in a discarded section. */ long indx; /* Symbol type. */ -- cgit v1.1