aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-07-04 13:38:28 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-07-04 11:38:28 +0000
commit70980ea225624d49591ae24262c55f2328517b62 (patch)
tree0595a9730706f417b4efb59cbd789c2e03932b55 /gcc/lto
parent07c91770f821ae9f6a567fb79b7f2ed675dfeaff (diff)
downloadgcc-70980ea225624d49591ae24262c55f2328517b62.zip
gcc-70980ea225624d49591ae24262c55f2328517b62.tar.gz
gcc-70980ea225624d49591ae24262c55f2328517b62.tar.bz2
Fix loading of lto_section on strict alignment targets (PR lto/91078).
2019-07-04 Martin Liska <mliska@suse.cz> PR lto/91078 * lto-common.c (lto_file_finalize): Use memcpy to set file_data->lto_section_header. From-SVN: r273077
Diffstat (limited to 'gcc/lto')
-rw-r--r--gcc/lto/ChangeLog6
-rw-r--r--gcc/lto/lto-common.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog
index 23ad84e..871598c 100644
--- a/gcc/lto/ChangeLog
+++ b/gcc/lto/ChangeLog
@@ -1,3 +1,9 @@
+2019-07-04 Martin Liska <mliska@suse.cz>
+
+ PR lto/91078
+ * lto-common.c (lto_file_finalize): Use memcpy to set
+ file_data->lto_section_header.
+
2019-07-03 Martin Liska <mliska@suse.cz>
* lto-common.c: Read LTO section and verify header.
diff --git a/gcc/lto/lto-common.c b/gcc/lto/lto-common.c
index bc8c2b4..3c6d7b2 100644
--- a/gcc/lto/lto-common.c
+++ b/gcc/lto/lto-common.c
@@ -2199,7 +2199,7 @@ lto_file_finalize (struct lto_file_decl_data *file_data, lto_file *file)
return;
}
- file_data->lto_section_header = *(const lto_section *)data;
+ memcpy (&file_data->lto_section_header, data, sizeof (lto_section));
lto_check_version (file_data->lto_section_header.major_version,
file_data->lto_section_header.minor_version,
file_data->file_name);