2010-05-14 Michael Snyder <msnyder@vmware.com>
[deliverable/binutils-gdb.git] / ld / ldexp.c
index 2d0382815f1e5b333294bb90f1195e2b6f0040eb..34d9eabde7f67506d79f54afdcdc262b194d7b30 100644 (file)
@@ -815,6 +815,28 @@ exp_fold_tree_1 (etree_type *tree)
              h->u.def.section = expld.result.section;
              if (tree->type.node_class == etree_provide)
                tree->type.node_class = etree_provided;
+
+             /* Copy the symbol type if this is a simple assignment of
+                one symbol to annother.  */
+             if (tree->assign.src->type.node_class == etree_name)
+               {
+                 struct bfd_link_hash_entry *hsrc;
+
+                 hsrc = bfd_link_hash_lookup (link_info.hash,
+                                              tree->assign.src->name.name,
+                                              FALSE, FALSE, TRUE);
+                 if (hsrc)
+                   bfd_copy_link_hash_symbol_type (link_info.output_bfd, h,
+                                                   hsrc);
+               }
+           }
+         else if (expld.phase == lang_final_phase_enum)
+           {
+             h = bfd_link_hash_lookup (link_info.hash, tree->assign.dst,
+                                       FALSE, FALSE, TRUE);
+             if (h != NULL
+                 && h->type == bfd_link_hash_new)
+               h->type = bfd_link_hash_undefined;
            }
        }
       break;
This page took 0.023844 seconds and 4 git commands to generate.