From: Richard Henderson Date: Fri, 17 Oct 1997 07:04:28 +0000 (+0000) Subject: * elflink.h (elf_link_assign_sym_version): For explicitly versioned X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=bccab6306ff41f723908b123579a272a6556885e;p=deliverable%2Fbinutils-gdb.git * elflink.h (elf_link_assign_sym_version): For explicitly versioned symbols, check globals list before matching on locals. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fdef6eacf4..ba65a889ae 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +Fri Oct 17 00:04:13 1997 Richard Henderson + + * elflink.h (elf_link_assign_sym_version): For explicitly versioned + symbols, check globals list before matching on locals. + Thu Oct 16 08:17:06 1997 Michael Meissner * peicode.h (coff_swap_scnhdr_out,pe_print_idata): Fix mangled diff --git a/bfd/elflink.h b/bfd/elflink.h index 974d8f06c1..bfb5d846e7 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -3108,26 +3108,37 @@ elf_link_assign_sym_version (h, data) { if (strcmp (t->name, p) == 0) { + int len; + char *alc; + struct bfd_elf_version_expr *d; + + len = p - h->root.root.string; + alc = bfd_alloc (sinfo->output_bfd, len); + if (alc == NULL) + return false; + strncpy (alc, h->root.root.string, len - 1); + alc[len - 1] = '\0'; + if (alc[len - 2] == ELF_VER_CHR) + alc[len - 2] = '\0'; + h->verinfo.vertree = t; t->used = true; + d = NULL; + + if (t->globals != NULL) + { + for (d = t->globals; d != NULL; d = d->next) + { + if ((d->match[0] == '*' && d->match[1] == '\0') + || fnmatch (d->match, alc, 0) == 0) + break; + } + } /* See if there is anything to force this symbol to local scope. */ - if (t->locals != NULL) + if (d == NULL && t->locals != NULL) { - int len; - char *alc; - struct bfd_elf_version_expr *d; - - len = p - h->root.root.string; - alc = bfd_alloc (sinfo->output_bfd, len); - if (alc == NULL) - return false; - strncpy (alc, h->root.root.string, len - 1); - alc[len - 1] = '\0'; - if (alc[len - 2] == ELF_VER_CHR) - alc[len - 2] = '\0'; - for (d = t->locals; d != NULL; d = d->next) { if ((d->match[0] == '*' && d->match[1] == '\0') @@ -3150,10 +3161,9 @@ elf_link_assign_sym_version (h, data) break; } } - - bfd_release (sinfo->output_bfd, alc); } + bfd_release (sinfo->output_bfd, alc); break; } }