From: Nick Clifton Date: Sun, 10 Sep 2000 19:17:08 +0000 (+0000) Subject: Emit 8 NULs for target section name instead of dumping core when the target X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ff0829fd43f9844232e794f5be9f70fa20204616;p=binutils-gdb.git Emit 8 NULs for target section name instead of dumping core when the target symbol is undefined. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 4d85c7933e4..ff7dcd4869a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2000-09-10 Michael Sokolov + + * 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 * riscix.c: Remove DEFUN. diff --git a/bfd/coff-m68k.c b/bfd/coff-m68k.c index 3ae98dbd12c..c5e60911317 100644 --- a/bfd/coff-m68k.c +++ b/bfd/coff-m68k.c @@ -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;