From: Nick Clifton Date: Wed, 25 Apr 2001 09:11:31 +0000 (+0000) Subject: Check to see if the filename symbol has been initialised before extracting X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ea3b9044a6a4a86bf3c1208e68499e145fedf9d8;p=binutils-gdb.git Check to see if the filename symbol has been initialised before extracting its symbol index. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 5d382edac33..6bdaec0d7c5 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2001-04-25 Nick Clifton + + * config/obj-coff.c (do_linenos_for): Check to see if the filename + symbol has been initialised before extracting its symbol index. + 2001-04-24 H.J. Lu * configure: Regenerated with the right version of autoconf. diff --git a/gas/config/obj-coff.c b/gas/config/obj-coff.c index 2527fefb356..37aa6404df0 100644 --- a/gas/config/obj-coff.c +++ b/gas/config/obj-coff.c @@ -2076,7 +2076,7 @@ fill_section (abfd, h, file_cursor) if (s->s_name[0]) { fragS *frag = segment_info[i].frchainP->frch_root; - char *buffer; + char *buffer = NULL; if (s->s_size == 0) s->s_scnptr = 0; @@ -3350,12 +3350,13 @@ do_linenos_for (abfd, h, file_cursor) line_ptr != (struct lineno_list *) NULL; line_ptr = line_ptr->next) { - if (line_ptr->line.l_lnno == 0) { - /* Turn a pointer to a symbol into the symbols' index */ - line_ptr->line.l_addr.l_symndx = - ((symbolS *) line_ptr->line.l_addr.l_symndx)->sy_number; + /* Turn a pointer to a symbol into the symbols' index, + provided that it has been initialised. */ + if (line_ptr->line.l_addr.l_symndx) + line_ptr->line.l_addr.l_symndx = + ((symbolS *) line_ptr->line.l_addr.l_symndx)->sy_number; } else {