From 036036c57ba1a06ad6418422ae3cda1abb7023fa Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 3 Feb 2005 14:12:49 +0000 Subject: [PATCH] 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. --- bfd/ChangeLog | 6 ++++++ bfd/elflink.c | 13 +++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 72eaad8bf7..064499ade0 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2005-02-04 Alan Modra + + * 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. + 2005-02-03 Alan Modra * linker.c (_bfd_link_hash_newfunc): Set all local fields. diff --git a/bfd/elflink.c b/bfd/elflink.c index ba2676dfdf..4ece121ea3 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -440,13 +440,15 @@ bfd_elf_record_link_assignment (bfd *output_bfd ATTRIBUTE_UNUSED, bfd_boolean provide) { struct elf_link_hash_entry *h; + struct elf_link_hash_table *htab; if (!is_elf_hash_table (info->hash)) return TRUE; - h = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, TRUE, FALSE); + htab = elf_hash_table (info); + h = elf_link_hash_lookup (htab, name, !provide, TRUE, FALSE); if (h == NULL) - return FALSE; + return provide; /* Since we're defining the symbol, don't let it seem to have not been defined. record_dynamic_symbol and size_dynamic_sections @@ -454,11 +456,9 @@ bfd_elf_record_link_assignment (bfd *output_bfd ATTRIBUTE_UNUSED, if (h->root.type == bfd_link_hash_undefweak || h->root.type == bfd_link_hash_undefined) { - struct elf_link_hash_table *htab = elf_hash_table (info); - + h->root.type = bfd_link_hash_new; if (h->root.u.undef.next != NULL || htab->root.undefs_tail == &h->root) bfd_link_repair_undef_list (&htab->root); - h->root.type = bfd_link_hash_new; } if (h->root.type == bfd_link_hash_new) @@ -2844,7 +2844,8 @@ elf_smash_syms (struct elf_link_hash_entry *h, void *data) case bfd_link_hash_undefined: if (h->root.u.undef.abfd != inf->not_needed) return TRUE; - if (h->root.u.undef.weak != NULL) + if (h->root.u.undef.weak != NULL + && h->root.u.undef.weak != inf->not_needed) { /* Symbol was undefweak in u.undef.weak bfd, and has become undefined in as-needed lib. Restore weak. */ -- 2.11.0