This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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)
     {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]