From: Richard Guenther Date: Wed, 12 Jan 2011 12:04:39 +0000 (+0000) Subject: re PR lto/47264 (Many tests fail with -flto due unaligned load in lto-plugin.c) X-Git-Tag: releases/gcc-4.6.0~1307 X-Git-Url: https://gcc.gnu.org/git/?a=commitdiff_plain;h=47782a9d27a4416cfab25b95f32f037b10833ecb;p=gcc.git re PR lto/47264 (Many tests fail with -flto due unaligned load in lto-plugin.c) 2011-01-12 Richard Guenther PR lto/47264 * lto-plugin.c (parse_table_entry): Use memcpy to access unaligned fields. From-SVN: r168708 --- diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog index d802828f0e5d..4b1200289ede 100644 --- a/lto-plugin/ChangeLog +++ b/lto-plugin/ChangeLog @@ -1,3 +1,9 @@ +2011-01-12 Richard Guenther + + PR lto/47264 + * lto-plugin.c (parse_table_entry): Use memcpy to access + unaligned fields. + 2010-12-20 Dave Korn * Makefile.am (AM_LIBTOOLFLAGS): Define, adding disable-static tag. diff --git a/lto-plugin/lto-plugin.c b/lto-plugin/lto-plugin.c index ab18f4c6d9c1..2f422a3dd70d 100644 --- a/lto-plugin/lto-plugin.c +++ b/lto-plugin/lto-plugin.c @@ -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;