aboutsummaryrefslogtreecommitdiff
path: root/ld/ldexp.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-06-07 13:58:53 +0930
committerAlan Modra <amodra@gmail.com>2014-06-07 14:55:12 +0930
commitb893397a4b1316610f49819344817715e4305de9 (patch)
treeb32b05e03c9f506c2e28f28f6b5c1c1eff0a3e8b /ld/ldexp.c
parenta47622ac1badbd906c7533ef6011b6bb021271ee (diff)
downloadgdb-b893397a4b1316610f49819344817715e4305de9.zip
gdb-b893397a4b1316610f49819344817715e4305de9.tar.gz
gdb-b893397a4b1316610f49819344817715e4305de9.tar.bz2
PROVIDE in linker script vs. built-in symbols
* ldexp.c (exp_fold_tree_1 <etree_provide>): Make PROVIDEd linker script symbol value override a built-in linker symbol.
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r--ld/ldexp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ld/ldexp.c b/ld/ldexp.c
index d573fb7..5c4f8dd 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -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. */