diff options
Diffstat (limited to 'gcc/lto-opts.c')
-rw-r--r-- | gcc/lto-opts.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/lto-opts.c b/gcc/lto-opts.c index b7bf6ca2c96..fa52f953608 100644 --- a/gcc/lto-opts.c +++ b/gcc/lto-opts.c @@ -31,6 +31,7 @@ along with GCC; see the file COPYING3. If not see #include "opts.h" #include "options.h" #include "target.h" +#include "diagnostic-core.h" #include "toplev.h" #include "lto-streamer.h" @@ -293,7 +294,7 @@ output_options (struct lto_output_stream *stream) void lto_write_options (void) { - char *const section_name = lto_get_section_name (LTO_section_opts, NULL); + char *const section_name = lto_get_section_name (LTO_section_opts, NULL, NULL); struct lto_output_stream stream; struct lto_simple_header header; struct lto_output_stream *header_stream; @@ -355,6 +356,8 @@ lto_read_file_options (struct lto_file_decl_data *file_data) struct lto_input_block ib; data = lto_get_section_data (file_data, LTO_section_opts, NULL, &len); + if (!data) + return; header = (const struct lto_simple_header *) data; opts_offset = sizeof (*header); |