From: Clément Chigot Date: Thu, 29 Jul 2021 12:22:54 +0000 (+0200) Subject: bfd: avoid a crash when debug_section isn't created in XCOFF X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1417c848426871e767342ffbc673198145f4cec7;p=binutils-gdb.git bfd: avoid a crash when debug_section isn't created in XCOFF bfd/ * xcofflink.c (bfd_xcoff_size_dynamic_sections): Add check to know if debug_section is initialized. --- diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index e18efd4381a..a00ae895e41 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -3992,7 +3992,8 @@ bfd_xcoff_size_dynamic_sections (bfd *output_bfd, } } - if (info->strip != strip_all) + if (info->strip != strip_all + && xcoff_hash_table (info)->debug_section != NULL) xcoff_hash_table (info)->debug_section->size = _bfd_stringtab_size (debug_strtab);