aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-12-01 15:02:45 +0000
committerNick Clifton <nickc@redhat.com>2016-12-01 15:02:45 +0000
commit4cbd84083ea89e870526ed0c80d462084887ba6e (patch)
tree333287b1f726afee98a22e8c5cf144c4e2e50b59
parent4ee1d7e401a8c1aedfdc86aac7faa8267eab1e5c (diff)
downloadgdb-4cbd84083ea89e870526ed0c80d462084887ba6e.zip
gdb-4cbd84083ea89e870526ed0c80d462084887ba6e.tar.gz
gdb-4cbd84083ea89e870526ed0c80d462084887ba6e.tar.bz2
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.
-rw-r--r--gas/ChangeLog4
-rw-r--r--gas/subsegs.c4
2 files changed, 8 insertions, 0 deletions
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)
{