Check to see if the filename symbol has been initialised before extracting
authorNick Clifton <nickc@redhat.com>
Wed, 25 Apr 2001 09:11:31 +0000 (09:11 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 25 Apr 2001 09:11:31 +0000 (09:11 +0000)
its symbol index.

gas/ChangeLog
gas/config/obj-coff.c

index 5d382edac333b9916093d7a51502483f0201bfe7..6bdaec0d7c593c13a04f560733480e142870831a 100644 (file)
@@ -1,3 +1,8 @@
+2001-04-25  Nick Clifton  <nickc@cambridge.redhat.com>
+
+       * 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  <hjl@gnu.org>
 
        * configure: Regenerated with the right version of autoconf.
index 2527fefb356a0ac82adff6bf5aec3a21e5d4433f..37aa6404df0c0e56855e488d846a80f42123f00d 100644 (file)
@@ -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
                {