summaryrefslogtreecommitdiff
path: root/lto-plugin
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-12 12:04:39 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-12 12:04:39 +0000
commitcf8c9708625c9dda447f95cf625560bc4b80d3c0 (patch)
treea42ffd810c5aade05f0953b22294d9fe86149c13 /lto-plugin
parentf97b152fcdd1b1638ac9a839efb9ee16fffe16c5 (diff)
2011-01-12 Richard Guenther <rguenther@suse.de>
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
Diffstat (limited to 'lto-plugin')
-rw-r--r--lto-plugin/ChangeLog6
-rw-r--r--lto-plugin/lto-plugin.c4
2 files changed, 8 insertions, 2 deletions
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 <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.
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;