summaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2000-02-13 23:11:32 +0000
committerRichard Henderson <rth@redhat.com>2000-02-13 23:11:32 +0000
commitca2bcd75b3713b35c0d0558ca0840c0cb850ab18 (patch)
tree52a4358f26287103fe47168966755611e0cb9d64 /bfd/elflink.h
parenta9d547eba6a4b6c60b15a54479cfea7e21c3e36c (diff)
downloadbinutils-redhat-ca2bcd75b3713b35c0d0558ca0840c0cb850ab18.tar.gz
* elf-bfd.h (struct elf_link_hash_table): Add copy_indirect and
hide_symbol members. (elf_link_hash_copy_indirect): New. (elf_link_hash_hide_symbol): New. * elflink.h (elf_link_add_object_symbols): Break out copy from indirect new new symbol to elf.c. (elf_link_assign_sym_version): Break out privatization of non-exported symbol to elf.c. * elf.c (_bfd_elf_link_hash_copy_indirect): New. (_bfd_elf_link_hash_hide_symbol): New. (_bfd_elf_link_hash_table_init): Init copy_indirect and hide_symbol.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h95
1 files changed, 8 insertions, 87 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index ce71d948c4..5bce1356a8 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -1734,45 +1734,8 @@ elf_link_add_object_symbols (abfd, info)
== 0);
ht = (struct elf_link_hash_entry *) hi->root.u.i.link;
-
- /* Copy down any references that we may have
- already seen to the symbol which just became
- indirect. */
- ht->elf_link_hash_flags |=
- (hi->elf_link_hash_flags
- & (ELF_LINK_HASH_REF_DYNAMIC
- | ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK
- | ELF_LINK_NON_GOT_REF));
-
- /* Copy over the global and procedure linkage table
- offset entries. These may have been already set
- up by a check_relocs routine. */
- if (ht->got.offset == (bfd_vma) -1)
- {
- ht->got.offset = hi->got.offset;
- hi->got.offset = (bfd_vma) -1;
- }
- BFD_ASSERT (hi->got.offset == (bfd_vma) -1);
-
- if (ht->plt.offset == (bfd_vma) -1)
- {
- ht->plt.offset = hi->plt.offset;
- hi->plt.offset = (bfd_vma) -1;
- }
- BFD_ASSERT (hi->plt.offset == (bfd_vma) -1);
-
- if (ht->dynindx == -1)
- {
- ht->dynindx = hi->dynindx;
- ht->dynstr_index = hi->dynstr_index;
- hi->dynindx = -1;
- hi->dynstr_index = 0;
- }
- BFD_ASSERT (hi->dynindx == -1);
-
- /* FIXME: There may be other information to copy
- over for particular targets. */
+ elf_link_hash_copy_indirect (elf_hash_table (info),
+ ht, hi);
/* See if the new flags lead us to realize that
the symbol must be dynamic. */
@@ -1845,44 +1808,8 @@ elf_link_add_object_symbols (abfd, info)
| ELF_LINK_HASH_DEF_REGULAR))
== 0);
- /* Copy down any references that we may have
- already seen to the symbol which just
- became indirect. */
- h->elf_link_hash_flags |=
- (hi->elf_link_hash_flags
- & (ELF_LINK_HASH_REF_DYNAMIC
- | ELF_LINK_HASH_REF_REGULAR
- | ELF_LINK_HASH_REF_REGULAR_NONWEAK
- | ELF_LINK_NON_GOT_REF));
-
- /* Copy over the global and procedure linkage
- table offset entries. These may have been
- already set up by a check_relocs routine. */
- if (h->got.offset == (bfd_vma) -1)
- {
- h->got.offset = hi->got.offset;
- hi->got.offset = (bfd_vma) -1;
- }
- BFD_ASSERT (hi->got.offset == (bfd_vma) -1);
-
- if (h->plt.offset == (bfd_vma) -1)
- {
- h->plt.offset = hi->plt.offset;
- hi->plt.offset = (bfd_vma) -1;
- }
- BFD_ASSERT (hi->got.offset == (bfd_vma) -1);
-
- if (h->dynindx == -1)
- {
- h->dynindx = hi->dynindx;
- h->dynstr_index = hi->dynstr_index;
- hi->dynindx = -1;
- hi->dynstr_index = 0;
- }
- BFD_ASSERT (hi->dynindx == -1);
-
- /* FIXME: There may be other information to
- copy over for particular targets. */
+ elf_link_hash_copy_indirect (elf_hash_table (info),
+ h, hi);
/* See if the new flags lead us to realize
that the symbol must be dynamic. */
@@ -3758,10 +3685,8 @@ elf_link_assign_sym_version (h, data)
&& ! sinfo->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
- h->elf_link_hash_flags &=~
- ELF_LINK_HASH_NEEDS_PLT;
- h->dynindx = -1;
- h->plt.offset = (bfd_vma) -1;
+ elf_link_hash_hide_symbol (elf_hash_table (info),
+ h);
/* FIXME: The name of the symbol has
already been recorded in the dynamic
string table section. */
@@ -3873,9 +3798,7 @@ elf_link_assign_sym_version (h, data)
&& ! sinfo->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
- h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
- h->dynindx = -1;
- h->plt.offset = (bfd_vma) -1;
+ elf_link_hash_hide_symbol (elf_hash_table (info), h);
/* FIXME: The name of the symbol has already
been recorded in the dynamic string table
section. */
@@ -3897,9 +3820,7 @@ elf_link_assign_sym_version (h, data)
&& ! sinfo->export_dynamic)
{
h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
- h->elf_link_hash_flags &=~ ELF_LINK_HASH_NEEDS_PLT;
- h->dynindx = -1;
- h->plt.offset = (bfd_vma) -1;
+ elf_link_hash_hide_symbol (elf_hash_table (info), h);
/* FIXME: The name of the symbol has already been
recorded in the dynamic string table section. */
}