summaryrefslogtreecommitdiff
path: root/gcc/lto-section-in.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-04 11:25:50 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-03-04 11:25:50 +0000
commitbaa4a2c65a59d4723a03b229e5438eca0009932c (patch)
treea80cc2694efb22749344a087ddb94257dbd5480a /gcc/lto-section-in.c
parentd3f82773366b137849824dab846c1796d84eb7c4 (diff)
downloadgcc-baa4a2c65a59d4723a03b229e5438eca0009932c.tar.gz
2014-03-04 Richard Biener <rguenther@suse.de>
PR lto/60405 * lto-streamer-in.c (lto_read_body): Remove LTO bytecode version check. (lto_input_toplevel_asms): Likewise. * lto-section-in.c (lto_get_section_data): Instead do it here for every section. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@208311 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-section-in.c')
-rw-r--r--gcc/lto-section-in.c42
1 files changed, 23 insertions, 19 deletions
diff --git a/gcc/lto-section-in.c b/gcc/lto-section-in.c
index 47f9739c4d0..60346dc7a26 100644
--- a/gcc/lto-section-in.c
+++ b/gcc/lto-section-in.c
@@ -153,26 +153,30 @@ lto_get_section_data (struct lto_file_decl_data *file_data,
/* FIXME lto: WPA mode does not write compressed sections, so for now
suppress uncompression if flag_ltrans. */
- if (flag_ltrans)
- return data;
-
- /* Create a mapping header containing the underlying data and length,
- and prepend this to the uncompression buffer. The uncompressed data
- then follows, and a pointer to the start of the uncompressed data is
- returned. */
- header = (struct lto_data_header *) xmalloc (header_length);
- header->data = data;
- header->len = *len;
-
- buffer.data = (char *) header;
- buffer.length = header_length;
-
- stream = lto_start_uncompression (lto_append_data, &buffer);
- lto_uncompress_block (stream, data, *len);
- lto_end_uncompression (stream);
+ if (!flag_ltrans)
+ {
+ /* Create a mapping header containing the underlying data and length,
+ and prepend this to the uncompression buffer. The uncompressed data
+ then follows, and a pointer to the start of the uncompressed data is
+ returned. */
+ header = (struct lto_data_header *) xmalloc (header_length);
+ header->data = data;
+ header->len = *len;
+
+ buffer.data = (char *) header;
+ buffer.length = header_length;
+
+ stream = lto_start_uncompression (lto_append_data, &buffer);
+ lto_uncompress_block (stream, data, *len);
+ lto_end_uncompression (stream);
+
+ *len = buffer.length - header_length;
+ data = buffer.data + header_length;
+ }
- *len = buffer.length - header_length;
- return buffer.data + header_length;
+ lto_check_version (((lto_header *)data)->major_version,
+ ((lto_header *)data)->minor_version);
+ return data;
}