summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2012-08-28 20:13:27 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2012-08-28 20:13:27 +0000
commitaed81c4e9cc4f24eba4da3564f0e99bd667188c7 (patch)
treeb3df06fec4f5c3ee4d457bae3020283f5b1357ef
parent18c1b81abee59b25ba6b68f7c715843b870f9bc6 (diff)
downloadppe42-binutils-aed81c4e9cc4f24eba4da3564f0e99bd667188c7.tar.gz
ppe42-binutils-aed81c4e9cc4f24eba4da3564f0e99bd667188c7.zip
* elflink.c (_bfd_elf_merge_symbol): Also override the version
a dynamic symbol defaulted to if preempted with a hidden or internal definition.
-rw-r--r--bfd/ChangeLog6
-rw-r--r--bfd/elflink.c30
2 files changed, 22 insertions, 14 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 2165b0c96e..e3ddd6ffdb 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2012-08-28 Maciej W. Rozycki <macro@codesourcery.com>
+
+ * elflink.c (_bfd_elf_merge_symbol): Also override the version
+ a dynamic symbol defaulted to if preempted with a hidden or
+ internal definition.
+
2012-08-28 Walter Lee <walt@tilera.com>
* elf32-tilepro.c (allocate_dynrelocs): Use PLT_ENTRY_SIZE as size
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 733511491d..3ef3f9bf5f 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -1210,23 +1210,25 @@ _bfd_elf_merge_symbol (bfd *abfd,
vh->root.type = h->root.type;
h->root.type = bfd_link_hash_indirect;
(*bed->elf_backend_copy_indirect_symbol) (info, vh, h);
- /* Protected symbols will override the dynamic definition
- with default version. */
- if (ELF_ST_VISIBILITY (sym->st_other) == STV_PROTECTED)
+
+ h->root.u.i.link = (struct bfd_link_hash_entry *) vh;
+ if (ELF_ST_VISIBILITY (sym->st_other) != STV_PROTECTED)
{
- h->root.u.i.link = (struct bfd_link_hash_entry *) vh;
- vh->dynamic_def = 1;
- vh->ref_dynamic = 1;
+ /* If the new symbol is hidden or internal, completely undo
+ any dynamic link state. */
+ (*bed->elf_backend_hide_symbol) (info, h, TRUE);
+ h->forced_local = 0;
+ h->ref_dynamic = 0;
}
else
- {
- h->root.type = vh->root.type;
- vh->ref_dynamic = 0;
- /* We have to hide it here since it was made dynamic
- global with extra bits when the symbol info was
- copied from the old dynamic definition. */
- (*bed->elf_backend_hide_symbol) (info, vh, TRUE);
- }
+ h->ref_dynamic = 1;
+
+ h->def_dynamic = 0;
+ h->dynamic_def = 0;
+ /* FIXME: Should we check type and size for protected symbol? */
+ h->size = 0;
+ h->type = 0;
+
h = vh;
}
else
OpenPOWER on IntegriCloud