From e3c9d234679ca83002a4af561dfe18cffd3f99f1 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 25 Mar 2013 06:06:35 +0000 Subject: [PATCH] * elflink.c (_bfd_elf_add_default_symbol): Delete "override" param. (elf_link_add_object_symbols): Don't call _bfd_elf_add_default_symbol when override is true. --- bfd/ChangeLog | 6 ++++++ bfd/elflink.c | 28 +++++----------------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f4e80c92853..62e521c47c8 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2013-03-25 Alan Modra + + * elflink.c (_bfd_elf_add_default_symbol): Delete "override" param. + (elf_link_add_object_symbols): Don't call _bfd_elf_add_default_symbol + when override is true. + 2013-03-25 Alan Modra * elflink.c (_bfd_elf_merge_symbol): Use local var holding value diff --git a/bfd/elflink.c b/bfd/elflink.c index b57bcd2b1b2..89a12e01496 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -1579,8 +1579,7 @@ _bfd_elf_add_default_symbol (bfd *abfd, Elf_Internal_Sym *sym, asection **psec, bfd_vma *value, - bfd_boolean *dynsym, - bfd_boolean override) + bfd_boolean *dynsym) { bfd_boolean type_change_ok; bfd_boolean size_change_ok; @@ -1591,6 +1590,7 @@ _bfd_elf_add_default_symbol (bfd *abfd, const struct elf_backend_data *bed; bfd_boolean collect; bfd_boolean dynamic; + bfd_boolean override; char *p; size_t len, shortlen; asection *sec; @@ -1603,24 +1603,6 @@ _bfd_elf_add_default_symbol (bfd *abfd, if (p == NULL || p[1] != ELF_VER_CHR) return TRUE; - if (override) - { - /* We are overridden by an old definition. We need to check if we - need to create the indirect symbol from the default name. */ - hi = elf_link_hash_lookup (elf_hash_table (info), name, TRUE, - FALSE, FALSE); - BFD_ASSERT (hi != NULL); - if (hi == h) - return TRUE; - while (hi->root.type == bfd_link_hash_indirect - || hi->root.type == bfd_link_hash_warning) - { - hi = (struct elf_link_hash_entry *) hi->root.u.i.link; - if (hi == h) - return TRUE; - } - } - bed = get_elf_backend_data (abfd); collect = bed->collect; dynamic = (abfd->flags & DYNAMIC) != 0; @@ -4425,10 +4407,10 @@ error_free_dyn: /* Check to see if we need to add an indirect symbol for the default name. */ - if (definition || h->root.type == bfd_link_hash_common) + if (definition + || (!override && h->root.type == bfd_link_hash_common)) if (!_bfd_elf_add_default_symbol (abfd, info, h, name, isym, - &sec, &value, &dynsym, - override)) + &sec, &value, &dynsym)) goto error_free_vers; if (definition && !dynamic) -- 2.30.2