PROVIDE in linker script vs. built-in symbols
authorAlan Modra <amodra@gmail.com>
Sat, 7 Jun 2014 04:28:53 +0000 (13:58 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 7 Jun 2014 05:25:12 +0000 (14:55 +0930)
* ldexp.c (exp_fold_tree_1 <etree_provide>): Make PROVIDEd
linker script symbol value override a built-in linker symbol.

ld/ChangeLog
ld/ldexp.c

index c42cdc8adea83f1b3a5aff268e60f75675cce883..19f71ab946a3e5aa7aae03301060e314e34d59b1 100644 (file)
@@ -1,3 +1,8 @@
+2014-06-07  Alan Modra  <amodra@gmail.com>
+
+       * ldexp.c (exp_fold_tree_1 <etree_provide>): Make PROVIDEd
+       linker script symbol value override a built-in linker symbol.
+
 2014-06-05  Joel Brobecker  <brobecker@adacore.com>
 
        * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Add dependency on
index d573fb79db78c25bba6f870ace7801ab3f7ab5fb..5c4f8ddaa9fcff21bc150be4e658638e497dda1a 100644 (file)
@@ -1001,7 +1001,10 @@ exp_fold_tree_1 (etree_type *tree)
              if (h == NULL
                  || (h->type != bfd_link_hash_new
                      && h->type != bfd_link_hash_undefined
-                     && h->type != bfd_link_hash_common))
+                     && h->type != bfd_link_hash_common
+                     && !(h->type == bfd_link_hash_defined
+                          && (h->u.def.section->flags
+                              & SEC_LINKER_CREATED) != 0)))
                {
                  /* Do nothing.  The symbol was never referenced, or was
                     defined by some object.  */