aboutsummaryrefslogtreecommitdiff
path: root/gas/subsegs.c
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 /gas/subsegs.c
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.
Diffstat (limited to 'gas/subsegs.c')
-rw-r--r--gas/subsegs.c4
1 files changed, 4 insertions, 0 deletions
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)
{