diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2003-05-05 00:37:02 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2003-05-05 00:37:02 +0000 |
commit | d31e3dfee9bea01a1d860d6ceae2052f3ded8b83 (patch) | |
tree | 900ee7d52ca47f191b192022525ae49362031cfe | |
parent | 0ce3d317be781807abc8bf2643cd7e03e8dcbac5 (diff) | |
download | gdb-d31e3dfee9bea01a1d860d6ceae2052f3ded8b83.zip gdb-d31e3dfee9bea01a1d860d6ceae2052f3ded8b83.tar.gz gdb-d31e3dfee9bea01a1d860d6ceae2052f3ded8b83.tar.bz2 |
2003-05-04 H.J. Lu <hjl@gnu.org>
* elflink.h (elf_merge_symbol): Don't record a hidden/internal
symbol dynamic. Check indirection when removing the old
definition for symbols with non-default visibility.
(elf_add_default_symbol): Skip when told by elf_merge_symbol.
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/elflink.h | 25 |
2 files changed, 28 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 02ec313..7950b0a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2003-05-04 H.J. Lu <hjl@gnu.org> + + * elflink.h (elf_merge_symbol): Don't record a hidden/internal + symbol dynamic. Check indirection when removing the old + definition for symbols with non-default visibility. + (elf_add_default_symbol): Skip when told by elf_merge_symbol. + 2003-05-02 Nick Clifton <nickc@redhat.com> * elf32-xstormy16.c (xstormy16_elf_howto_table): Make the diff --git a/bfd/elflink.h b/bfd/elflink.h index 61505e0..3aec4e0 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -639,8 +639,14 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, skip, *skip = TRUE; /* Make sure this symbol is dynamic. */ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; - /* FIXME: Should we check type and size for protected symbol? */ - return _bfd_elf_link_record_dynamic_symbol (info, h); + /* A protected symbol has external availability. Make sure it is + recorded as dynamic. + + FIXME: Should we check type and size for protected symbol? */ + if (ELF_ST_VISIBILITY (h->other) == STV_PROTECTED) + return _bfd_elf_link_record_dynamic_symbol (info, h); + else + return TRUE; } else if (!newdyn && ELF_ST_VISIBILITY (sym->st_other) @@ -649,10 +655,15 @@ elf_merge_symbol (abfd, info, name, sym, psec, pvalue, sym_hash, skip, /* If the new symbol with non-default visibility comes from a relocatable file and the old definition comes from a dynamic object, we remove the old definition. */ + if ((*sym_hash)->root.type == bfd_link_hash_indirect) + h = *sym_hash; h->root.type = bfd_link_hash_new; h->root.u.undef.abfd = NULL; - h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC; - h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; + if (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) + { + h->elf_link_hash_flags &= ~ELF_LINK_HASH_DEF_DYNAMIC; + h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC; + } /* FIXME: Should we check type and size for protected symbol? */ h->size = 0; h->type = 0; @@ -1049,6 +1060,9 @@ elf_add_default_symbol (abfd, info, h, name, sym, psec, value, &size_change_ok, dt_needed)) return FALSE; + if (skip) + return TRUE; + if (! override) { bh = &hi->root; @@ -1158,6 +1172,9 @@ elf_add_default_symbol (abfd, info, h, name, sym, psec, value, &size_change_ok, dt_needed)) return FALSE; + if (skip) + return TRUE; + if (override) { /* Here SHORTNAME is a versioned name, so we don't expect to see |