aboutsummaryrefslogtreecommitdiff
path: root/bfd/coffgen.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2019-03-15 22:19:01 +0800
committerH.J. Lu <hjl.tools@gmail.com>2019-03-15 22:19:20 +0800
commit2219ae0b0ebe14373850b000c2abaa31dab1d741 (patch)
tree8f138e44655f3af01b98d9567157c192f9d06ad2 /bfd/coffgen.c
parent1c82ed745bec154a3cd8a8bbf36c5be5086041d5 (diff)
downloadgdb-2219ae0b0ebe14373850b000c2abaa31dab1d741.zip
gdb-2219ae0b0ebe14373850b000c2abaa31dab1d741.tar.gz
gdb-2219ae0b0ebe14373850b000c2abaa31dab1d741.tar.bz2
COFF: Check for symbols defined in discarded section
For LTO, a symbol may defined in discarded section. We should mark it as undefined so that LTO plugin will make IR definition available. PR ld/24267 * coffgen.c (_bfd_coff_section_already_linked): Skip discarded section. * cofflink.c (coff_link_add_symbols): Check for symbols defined in discarded section.
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r--bfd/coffgen.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c
index 5db35c7..ccf4b43 100644
--- a/bfd/coffgen.c
+++ b/bfd/coffgen.c
@@ -2652,6 +2652,9 @@ _bfd_coff_section_already_linked (bfd *abfd,
struct bfd_section_already_linked_hash_entry *already_linked_list;
struct coff_comdat_info *s_comdat;
+ if (sec->output_section == bfd_abs_section_ptr)
+ return FALSE;
+
flags = sec->flags;
if ((flags & SEC_LINK_ONCE) == 0)
return FALSE;