PR ld/11367
authorAlan Modra <amodra@gmail.com>
Wed, 10 Mar 2010 22:44:01 +0000 (22:44 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 10 Mar 2010 22:44:01 +0000 (22:44 +0000)
* ldcref.c (handle_asneeded_cref): Correct copying of refs.

ld/ChangeLog
ld/ldcref.c

index 797989162daca2a7fd4b5fed37604cd81531d774..9905b0a620cdd510c1a7de7e2c5a4e34ebe6c192 100644 (file)
@@ -1,3 +1,8 @@
+2010-03-11  George Gensure  <werkt0@gmail.com>
+
+       PR ld/11367
+       * ldcref.c (handle_asneeded_cref): Correct copying of refs.
+
 2010-03-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * Makefile.am (ALL_EMULATIONS): Add eelf32_sparc_sol2.o,
index c329d7d9646e54e618ec5094b1d667c2bccf029e..2f6a46caead990ba5849c9db71f9f08f7222b330 100644 (file)
@@ -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);
                }
            }
        }