summaryrefslogtreecommitdiff
path: root/ld/ldcref.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2010-03-10 22:44:00 +0000
committerAlan Modra <amodra@bigpond.net.au>2010-03-10 22:44:00 +0000
commit08142c5dce77f2741170d10debc6fa79f26cf6ab (patch)
treefba12b0280ff2059fa135cd54fb44dff24745e9e /ld/ldcref.c
parent5e97bb2d785000f98f31cd3bf3f8bb2d0186ed32 (diff)
downloadbinutils-redhat-08142c5dce77f2741170d10debc6fa79f26cf6ab.tar.gz
PR ld/11367
* ldcref.c (handle_asneeded_cref): Correct copying of refs.
Diffstat (limited to 'ld/ldcref.c')
-rw-r--r--ld/ldcref.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ld/ldcref.c b/ld/ldcref.c
index c329d7d964..2f6a46caea 100644
--- a/ld/ldcref.c
+++ b/ld/ldcref.c
@@ -226,7 +226,7 @@ handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED,
entsize += cref_table.root.entsize;
c = (struct cref_hash_entry *) p;
for (r = c->refs; r != NULL; r = r->next)
- refsize += sizeof (struct cref_hash_entry);
+ refsize += sizeof (struct cref_ref);
}
}
@@ -258,8 +258,8 @@ handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED,
c = (struct cref_hash_entry *) p;
for (r = c->refs; r != NULL; r = r->next)
{
- memcpy (old_ref, r, sizeof (struct cref_hash_entry));
- old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
+ memcpy (old_ref, r, sizeof (struct cref_ref));
+ old_ref = (char *) old_ref + sizeof (struct cref_ref);
}
}
}
@@ -300,8 +300,8 @@ handle_asneeded_cref (bfd *abfd ATTRIBUTE_UNUSED,
c = (struct cref_hash_entry *) p;
for (r = c->refs; r != NULL; r = r->next)
{
- memcpy (r, old_ref, sizeof (struct cref_hash_entry));
- old_ref = (char *) old_ref + sizeof (struct cref_hash_entry);
+ memcpy (r, old_ref, sizeof (struct cref_ref));
+ old_ref = (char *) old_ref + sizeof (struct cref_ref);
}
}
}