OSDN Git Service

2011-01-12 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Jan 2011 12:04:39 +0000 (12:04 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 12 Jan 2011 12:04:39 +0000 (12:04 +0000)
PR lto/47264
* lto-plugin.c (parse_table_entry): Use memcpy to access
unaligned fields.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@168708 138bc75d-0d04-0410-961f-82ee72b054a4

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

index d802828..4b12002 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 ab18f4c..2f422a3 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;