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.
This commit is contained in:
Nick Clifton
2020-10-28 11:07:02 +00:00
parent ec3f28df02
commit 2aec1123f9
2 changed files with 10 additions and 1 deletions
+6
View File
@@ -1,3 +1,9 @@
2020-10-28 Nick Clifton <nickc@redhat.com>
PR 26774
* srec.c (srec_write_symbols): Do not emit symbols in sections
that have been removed from the output.
2020-10-27 Nick Clifton <nickc@redhat.com>
* elf64-hppa.c (elf_hppa_final_link_relocate): Check that the
+4 -1
View File
@@ -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;