aboutsummaryrefslogtreecommitdiff
path: root/ld/emultempl
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2005-02-03 14:12:54 +0000
committerAlan Modra <amodra@gmail.com>2005-02-03 14:12:54 +0000
commit4ea42fb74f7eeda2968163eaa74a10139c4a04b2 (patch)
tree7b617c4fbeea4bf94c73070375faf7baae7aa25b /ld/emultempl
parent10d86c8a5c3965bfcc895c7e6a624cd3fd6e240d (diff)
downloadgdb-4ea42fb74f7eeda2968163eaa74a10139c4a04b2.zip
gdb-4ea42fb74f7eeda2968163eaa74a10139c4a04b2.tar.gz
gdb-4ea42fb74f7eeda2968163eaa74a10139c4a04b2.tar.bz2
bfd/
* elflink.c (bfd_elf_record_link_assignment): Do "provide" symbol lookup here. Set to new before calling bfd_link_repair_undef_list. (elf_smash_syms): Check that u.undef.weak isn't the not_needed bfd. ld/ emultempl/elf32.em (gld${EMULATION_NAME}_find_exp_assignment): Don't look up symbol for etree_provide here.
Diffstat (limited to 'ld/emultempl')
-rw-r--r--ld/emultempl/elf32.em18
1 files changed, 6 insertions, 12 deletions
diff --git a/ld/emultempl/elf32.em b/ld/emultempl/elf32.em
index fd35938..771a98c 100644
--- a/ld/emultempl/elf32.em
+++ b/ld/emultempl/elf32.em
@@ -931,16 +931,14 @@ cat >>e${EMULATION_NAME}.c <<EOF
static void
gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
{
- struct bfd_link_hash_entry *h;
+ bfd_boolean provide = FALSE;
switch (exp->type.node_class)
{
case etree_provide:
- h = bfd_link_hash_lookup (link_info.hash, exp->assign.dst,
- FALSE, FALSE, FALSE);
- if (h == NULL)
- break;
-
+ provide = TRUE;
+ /* Fall thru */
+ case etree_assign:
/* We call record_link_assignment even if the symbol is defined.
This is because if it is defined by a dynamic object, we
actually want to use the value defined by the linker script,
@@ -948,14 +946,10 @@ gld${EMULATION_NAME}_find_exp_assignment (etree_type *exp)
symbols like etext). If the symbol is defined by a regular
object, then, as it happens, calling record_link_assignment
will do no harm. */
-
- /* Fall through. */
- case etree_assign:
if (strcmp (exp->assign.dst, ".") != 0)
{
- if (! (bfd_elf_record_link_assignment
- (output_bfd, &link_info, exp->assign.dst,
- exp->type.node_class == etree_provide ? TRUE : FALSE)))
+ if (!bfd_elf_record_link_assignment (output_bfd, &link_info,
+ exp->assign.dst, provide))
einfo ("%P%F: failed to record assignment to %s: %E\n",
exp->assign.dst);
}