From 806fc311517a1001110c6d08ac34b0a78caf1e06 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 10 Mar 2010 22:44:01 +0000 Subject: [PATCH] PR ld/11367 * ldcref.c (handle_asneeded_cref): Correct copying of refs. --- ld/ChangeLog | 5 +++++ ld/ldcref.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ld/ChangeLog b/ld/ChangeLog index 797989162da..9905b0a620c 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2010-03-11 George Gensure + + PR ld/11367 + * ldcref.c (handle_asneeded_cref): Correct copying of refs. + 2010-03-05 Rainer Orth * Makefile.am (ALL_EMULATIONS): Add eelf32_sparc_sol2.o, diff --git a/ld/ldcref.c b/ld/ldcref.c index c329d7d9646..2f6a46caead 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); } } } -- 2.30.2