diff options
author | Nick Clifton <nickc@redhat.com> | 2000-01-03 18:32:21 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2000-01-03 18:32:21 +0000 |
commit | 7a13edea08cb46d90e1512c72540de7d0b1411a5 (patch) | |
tree | 6f4fcb7c2b1f1caa3527b12b4dca91e483bed78a /bfd/elflink.c | |
parent | ea44b73426cc8aa21a6b21eb5a523d53385e42e4 (diff) | |
download | gdb-7a13edea08cb46d90e1512c72540de7d0b1411a5.zip gdb-7a13edea08cb46d90e1512c72540de7d0b1411a5.tar.gz gdb-7a13edea08cb46d90e1512c72540de7d0b1411a5.tar.bz2 |
ELF visibility patch from Martin Loewis.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r-- | bfd/elflink.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c index c30915b..ce78b59 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -218,6 +218,32 @@ _bfd_elf_link_record_dynamic_symbol (info, h) boolean copy; bfd_size_type indx; + /* XXX: The ABI draft says the linker must turn hidden and + internal symbols into STB_LOCAL symbols when producing the + DSO. However, if ld.so honors st_other in the dynamic table, + this would not be necessary. */ + switch (ELF_ST_VISIBILITY (h->other)) + { + case STV_INTERNAL: + case STV_HIDDEN: + /* This symbol must be defined in the shared object or + executable. */ + if (h->root.type == bfd_link_hash_undefined) + { + bfd * abfd = h->root.u.undef.abfd; + char * name = h->root.root.string; + + (*info->callbacks->undefined_symbol) + (info, name, abfd, bfd_und_section_ptr, 0); + } + + h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL; + break; + + default: + break; + } + h->dynindx = elf_hash_table (info)->dynsymcount; ++elf_hash_table (info)->dynsymcount; |