Emit 8 NULs for target section name instead of dumping core when the target
authorNick Clifton <nickc@redhat.com>
Sun, 10 Sep 2000 19:17:08 +0000 (19:17 +0000)
committerNick Clifton <nickc@redhat.com>
Sun, 10 Sep 2000 19:17:08 +0000 (19:17 +0000)
 symbol is undefined.

bfd/ChangeLog
bfd/coff-m68k.c

index 4d85c7933e42d5a6f7daf98edbd85c7fe6ee0795..ff7dcd4869ab3e8d3ca9745cbe150203beab3b94 100644 (file)
@@ -1,3 +1,9 @@
+2000-09-10  Michael Sokolov  <msokolov@ivan.Harhan.ORG>
+
+       * coff-m68k.c (bfd_m68k_coff_create_embedded_relocs): Emit 8 NULs for
+       target section name instead of dumping core when the target symbol is
+       undefined.
+
 2000-09-09  Kazu Hirata  <kazu@hxi.com>
 
        * riscix.c: Remove DEFUN.
index 3ae98dbd12cc5a6abf95f7f087da51e0d1ce1fa5..c5e609113176c728bd4e522d978c879fc8d21015 100644 (file)
@@ -504,7 +504,8 @@ bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg)
       bfd_put_32 (abfd,
                  (irel->r_vaddr - datasec->vma + datasec->output_offset), p);
       memset (p + 4, 0, 8);
-      strncpy (p + 4, targetsec->output_section->name, 8);
+      if (targetsec != NULL)
+       strncpy (p + 4, targetsec->output_section->name, 8);
     }
   
   return true;