From: Nick Clifton Date: Thu, 1 Dec 2016 15:02:45 +0000 (+0000) Subject: Fix seg-fault printing assembler statistics when the output file was not created. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4cbd84083ea89e870526ed0c80d462084887ba6e;p=binutils-gdb.git Fix seg-fault printing assembler statistics when the output file was not created. PR gas/20897 * subsegs.c (subsegs_print_statistics): Do nothing if no output file was created. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 385ff56c0ed..76c23ce70ca 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,9 @@ 2016-12-01 Nick Clifton + PR gas/20897 + * subsegs.c (subsegs_print_statistics): Do nothing if no output + file was created. + PR gas/20895 * symbols.c (resolve_symbol_value): Gracefully handle erroneous symbolic expressions. diff --git a/gas/subsegs.c b/gas/subsegs.c index 0647653f878..ab0836c2278 100644 --- a/gas/subsegs.c +++ b/gas/subsegs.c @@ -297,6 +297,10 @@ subsegs_print_statistics (FILE *file) frchainS *frchp; asection *s; + /* PR 20897 - check to see if the output bfd was actually created. */ + if (stdoutput == NULL) + return; + fprintf (file, "frag chains:\n"); for (s = stdoutput->sections; s; s = s->next) {