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.
This commit is contained in:
Nick Clifton 2016-12-01 15:02:45 +00:00
parent 4ee1d7e401
commit 4cbd84083e
2 changed files with 8 additions and 0 deletions

View File

@ -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.

View File

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