aboutsummaryrefslogtreecommitdiff
path: root/ld/ldexp.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2015-10-27 12:01:55 +1030
committerAlan Modra <amodra@gmail.com>2015-10-27 12:54:59 +1030
commit321df0656c7557004a232b4ac3d8c354a59de364 (patch)
tree3aec2b2461c111ac10685f16931e7a7fe5757aae /ld/ldexp.c
parentd7f3ff3ea7830389f458be7c5eadb5d4a4e0a90b (diff)
downloadgdb-321df0656c7557004a232b4ac3d8c354a59de364.zip
gdb-321df0656c7557004a232b4ac3d8c354a59de364.tar.gz
gdb-321df0656c7557004a232b4ac3d8c354a59de364.tar.bz2
Evaluate __start_* and __stop_* symbol PROVIDE expressions early
Makes these symbols defined before bfd_elf_size_dynamic_sections, to avoid horrible hacks elsewhere. The exp_fold_tree undefweak change is necessary to define undefweak symbols early too. The comment was wrong. PROVIDE in fact defines undefweak symbols, via bfd_elf_record_link_assignment. PR ld/19175 * ldlang.c (lang_insert_orphan): Evaluate __start_* and __stop_* symbol PROVIDE expressions. * ldexp.c (exp_fold_tree_1 <etree_provide>): Define undefweak references.
Diffstat (limited to 'ld/ldexp.c')
-rw-r--r--ld/ldexp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ld/ldexp.c b/ld/ldexp.c
index 7694f7b..2ec8eb6 100644
--- a/ld/ldexp.c
+++ b/ld/ldexp.c
@@ -1126,11 +1126,14 @@ 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_undefweak
|| h->linker_def))
{
/* Do nothing. The symbol was never referenced, or
- was defined in some object file. Undefined weak
- symbols stay undefined. */
+ was defined in some object file. Note that
+ undefweak symbols are defined by PROVIDE. This
+ is to support glibc use of __rela_iplt_start and
+ similar weak references. */
break;
}
}