aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorClément Chigot <clement.chigot@atos.net>2021-07-29 14:22:54 +0200
committerClément Chigot <clement.chigot@atos.net>2021-07-30 08:37:15 +0200
commit1417c848426871e767342ffbc673198145f4cec7 (patch)
tree316419fefbc813485123c435dbb04503a891bb8c /bfd
parent237877b8183a23ecc889b5c796c210aac9cfb742 (diff)
downloadfsf-binutils-gdb-1417c848426871e767342ffbc673198145f4cec7.zip
fsf-binutils-gdb-1417c848426871e767342ffbc673198145f4cec7.tar.gz
fsf-binutils-gdb-1417c848426871e767342ffbc673198145f4cec7.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/xcofflink.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index e18efd4..a00ae89 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);