diff options
author | Nick Clifton <nickc@redhat.com> | 2020-10-28 11:07:02 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2020-10-28 11:07:02 +0000 |
commit | 2aec1123f9ec86cd190767c9852cb77ed2c017ec (patch) | |
tree | db8cbda501bce4940dd4410c493bd28577e565f4 /bfd/srec.c | |
parent | ec3f28df02b6a59be3cfd226e5f653221c10f7ee (diff) | |
download | gdb-2aec1123f9ec86cd190767c9852cb77ed2c017ec.zip gdb-2aec1123f9ec86cd190767c9852cb77ed2c017ec.tar.gz gdb-2aec1123f9ec86cd190767c9852cb77ed2c017ec.tar.bz2 |
Fix a potential illegal memory access when creating an srec format file.
PR 26774
* srec.c (srec_write_symbols): Do not emit symbols in sections
that have been removed from the output.
Diffstat (limited to 'bfd/srec.c')
-rw-r--r-- | bfd/srec.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1085,8 +1085,11 @@ srec_write_symbols (bfd *abfd) for (i = 0; i < count; i++) { asymbol *s = table[i]; + if (! bfd_is_local_label (abfd, s) - && (s->flags & BSF_DEBUGGING) == 0) + && (s->flags & BSF_DEBUGGING) == 0 + && s->section != NULL + && s->section->output_section != NULL) { /* Just dump out non debug symbols. */ char buf[43], *p; |