aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Harmstone <mark@harmstone.com>2022-12-09 01:52:33 +0000
committerAlan Modra <amodra@gmail.com>2022-12-23 19:49:47 +1030
commit8b182dc3c6e7f763504c0f0e9cf699da36d499dd (patch)
treeb578686742cfeccda7494568aef0b38fd5ed53e9
parent803561cb74922892a0c22ea4ff0564f448796c1c (diff)
downloadgdb-8b182dc3c6e7f763504c0f0e9cf699da36d499dd.zip
gdb-8b182dc3c6e7f763504c0f0e9cf699da36d499dd.tar.gz
gdb-8b182dc3c6e7f763504c0f0e9cf699da36d499dd.tar.bz2
ld: Fix segfault in populate_publics_stream
-rw-r--r--ld/pdb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ld/pdb.c b/ld/pdb.c
index 44ba21f..45c933e 100644
--- a/ld/pdb.c
+++ b/ld/pdb.c
@@ -1411,6 +1411,9 @@ populate_publics_stream (bfd *stream, bfd *abfd, bfd *sym_rec_stream)
for (bfd *in = coff_data (abfd)->link_info->input_bfds; in;
in = in->link.next)
{
+ if (!in->outsymbols)
+ continue;
+
for (unsigned int i = 0; i < in->symcount; i++)
{
struct bfd_symbol *sym = in->outsymbols[i];