]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR lto/47264 (Many tests fail with -flto due unaligned load in lto-plugin.c)
authorRichard Guenther <rguenther@suse.de>
Wed, 12 Jan 2011 12:04:39 +0000 (12:04 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 12 Jan 2011 12:04:39 +0000 (12:04 +0000)
2011-01-12  Richard Guenther  <rguenther@suse.de>

PR lto/47264
* lto-plugin.c (parse_table_entry): Use memcpy to access
unaligned fields.

From-SVN: r168708

lto-plugin/ChangeLog
lto-plugin/lto-plugin.c

index d802828f0e5d02f4eb43054aafb00f1c490da5cb..4b1200289ede012c2ef2e2c67114d46a279fc5c7 100644 (file)
@@ -1,3 +1,9 @@
+2011-01-12  Richard Guenther  <rguenther@suse.de>
+
+       PR lto/47264
+       * lto-plugin.c (parse_table_entry): Use memcpy to access
+       unaligned fields.
+
 2010-12-20  Dave Korn  <dave.korn.cygwin@gmail.com>
 
        * Makefile.am (AM_LIBTOOLFLAGS): Define, adding disable-static tag.
index ab18f4c6d9c1c6e2054eaf84fe1a8e963ef56403..2f422a3dd70d8aadf4b0bed7ce21b198778c1649 100644 (file)
@@ -249,10 +249,10 @@ parse_table_entry (char *p, struct ld_plugin_symbol *entry,
   entry->visibility = translate_visibility[t];
   p++;
 
-  entry->size = *(uint64_t *) p;
+  memcpy (&entry->size, p, sizeof (uint64_t));
   p += 8;
 
-  aux->slot = *(uint32_t *) p;
+  memcpy (&aux->slot, p, sizeof (uint32_t));
   p += 4;
 
   entry->resolution = LDPR_UNKNOWN;