summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>1997-10-17 07:04:28 +0000
committerRichard Henderson <rth@redhat.com>1997-10-17 07:04:28 +0000
commitbccab6306ff41f723908b123579a272a6556885e (patch)
tree16976aca8d3776dcddfd98d5366aad5f4fde666e
parentafb1dbe851c1395fd46213bb663b349d5768b35d (diff)
downloadppe42-binutils-bccab6306ff41f723908b123579a272a6556885e.tar.gz
ppe42-binutils-bccab6306ff41f723908b123579a272a6556885e.zip
* elflink.h (elf_link_assign_sym_version): For explicitly versioned
symbols, check globals list before matching on locals.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.h42
2 files changed, 31 insertions, 16 deletions
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 <rth@cygnus.com>
+
+ * 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 <meissner@cygnus.com>
* 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;
}
}
OpenPOWER on IntegriCloud