This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Fix seg-fault printing assembler statistics when the output file was not created.
- From: Nick Clifton <nickc at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 1 Dec 2016 15:03:22 -0000
- Subject: [binutils-gdb] Fix seg-fault printing assembler statistics when the output file was not created.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4cbd84083ea89e870526ed0c80d462084887ba6e
commit 4cbd84083ea89e870526ed0c80d462084887ba6e
Author: Nick Clifton <nickc@redhat.com>
Date: Thu Dec 1 15:02:45 2016 +0000
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:
---
gas/ChangeLog | 4 ++++
gas/subsegs.c | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 385ff56..76c23ce 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,9 @@
2016-12-01 Nick Clifton <nickc@redhat.com>
+ 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 0647653..ab0836c 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)
{