From: Martin Liska Date: Thu, 4 Jul 2019 11:38:28 +0000 (+0200) Subject: Fix loading of lto_section on strict alignment targets (PR lto/91078). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=70980ea225624d49591ae24262c55f2328517b62;p=gcc.git Fix loading of lto_section on strict alignment targets (PR lto/91078). 2019-07-04 Martin Liska PR lto/91078 * lto-common.c (lto_file_finalize): Use memcpy to set file_data->lto_section_header. From-SVN: r273077 --- diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 23ad84ecc75..871598cae51 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,9 @@ +2019-07-04 Martin Liska + + PR lto/91078 + * lto-common.c (lto_file_finalize): Use memcpy to set + file_data->lto_section_header. + 2019-07-03 Martin Liska * lto-common.c: Read LTO section and verify header. diff --git a/gcc/lto/lto-common.c b/gcc/lto/lto-common.c index bc8c2b40387..3c6d7b25ddb 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);