PR 338
authorAlan Modra <amodra@gmail.com>
Wed, 18 Aug 2004 02:45:43 +0000 (02:45 +0000)
committerAlan Modra <amodra@gmail.com>
Wed, 18 Aug 2004 02:45:43 +0000 (02:45 +0000)
* elflink.c (bfd_elf_record_link_assignment): Add comment about
changing bfd_link_hash_undefined to bfd_link_hash_new.
* ldexp.c (fold_name): Don't call bfd_link_add_undef if the symbol
was already on the undefs list.

bfd/ChangeLog
bfd/elflink.c
ld/ChangeLog
ld/ldexp.c

index e4f0e7a303cd32bf8e7265530fdf4d7cdc291d2e..7c24b394a34b3d19df4a9f7e2894b8674aaf8271 100644 (file)
@@ -1,3 +1,9 @@
+2004-08-18  Alan Modra  <amodra@bigpond.net.au>
+
+       PR 338
+       * elflink.c (bfd_elf_record_link_assignment): Add comment about
+       changing bfd_link_hash_undefined to bfd_link_hash_new.
+
 2004-08-17  Jakub Jelinek  <jakub@redhat.com>
 
        * elfxx-target.h (bfd_elfNN_get_synthetic_symtab): Only define
index 1e2f335d366c4d52c8f3f6a54de25cd578b01045..7793e82a3b49cbd31b27141b46b2427b3f83329a 100644 (file)
@@ -434,7 +434,12 @@ bfd_elf_record_link_assignment (bfd *output_bfd ATTRIBUTE_UNUSED,
 
   /* Since we're defining the symbol, don't let it seem to have not
      been defined.  record_dynamic_symbol and size_dynamic_sections
-     may depend on this.  */
+     may depend on this.
+     ??? Changing bfd_link_hash_undefined to bfd_link_hash_new (or
+     to bfd_link_hash_undefweak, see linker.c:link_action) runs the risk
+     of some later symbol manipulation setting the symbol back to
+     bfd_link_hash_undefined, and the linker trying to add the symbol to
+     the undefs list twice.  */
   if (h->root.type == bfd_link_hash_undefweak
       || h->root.type == bfd_link_hash_undefined)
     h->root.type = bfd_link_hash_new;
index d96be457f8a854700141550b153c0952d4f11867..a8b8ba4793b5d6b81b696f58fd6372a994824563 100644 (file)
@@ -1,3 +1,9 @@
+2004-08-18  Alan Modra  <amodra@bigpond.net.au>
+
+       PR 338
+       * ldexp.c (fold_name): Don't call bfd_link_add_undef if the symbol
+       was already on the undefs list.
+
 2004-08-17  Alan Modra  <amodra@bigpond.net.au>
 
        * emultempl/ppc64elf.em (gld${EMULATION_NAME}_new_vers_pattern): Dot
index 06b1fa1a2e2805b92274a0f568a1f6244ebdba83..e7587c17100d755fdcbffddde3deabba65cf7556 100644 (file)
@@ -576,7 +576,8 @@ fold_name (etree_type *tree,
            {
              h->type = bfd_link_hash_undefined;
              h->u.undef.abfd = NULL;
-             bfd_link_add_undef (link_info.hash, h);
+             if (h->und_next == NULL)
+               bfd_link_add_undef (link_info.hash, h);
            }
        }
       break;