diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2015-08-10 07:57:40 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2015-08-10 07:57:57 -0700 |
commit | 422f11824b3abf6c71042e2ee3aed572f250fc89 (patch) | |
tree | b5aaf430dc6e3a835909515d350a21ebbd10878c /bfd/elf-bfd.h | |
parent | 75fb7498c25ba89262867abe5340a8d38f1e19cd (diff) | |
download | gdb-422f11824b3abf6c71042e2ee3aed572f250fc89.zip gdb-422f11824b3abf6c71042e2ee3aed572f250fc89.tar.gz gdb-422f11824b3abf6c71042e2ee3aed572f250fc89.tar.bz2 |
Replace hidden with versioned in elf_link_hash_entry
This patch replaces the "hidden" field with the "versioned" field in
elf_link_hash_entry so that we can avoid calling strchr and strrchr if
the symbol is unversioned.
* elf-bfd.h (elf_symbol_version): New enum.
(elf_link_hash_entry): Replace hidden with versioned.
* elflink.c (_bfd_elf_merge_symbol): Don't look for symbol
version if the symbol is unversioned. Initialize versioned.
(_bfd_elf_add_default_symbol): Don't look for symbol version
if the symbol is unversioned or hidden. Initialize versioned.
(elf_collect_hash_codes): Don't look for symbol version if the
symbol is unversioned.
(elf_collect_gnu_hash_codes): Likewise.
(bfd_elf_gc_mark_dynamic_ref_symbol): Likewise.
(_bfd_elf_link_hash_copy_indirect): Check versioned instead of
hidden.
(elf_link_output_extsym): Likewise.
Diffstat (limited to 'bfd/elf-bfd.h')
-rw-r--r-- | bfd/elf-bfd.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h index e08b2d6..c92671a 100644 --- a/bfd/elf-bfd.h +++ b/bfd/elf-bfd.h @@ -108,6 +108,15 @@ struct elf_link_virtual_table_entry struct elf_link_hash_entry *parent; }; +/* ELF symbol version. */ +enum elf_symbol_version + { + unknown = 0, + unversioned, + versioned, + versioned_hidden + }; + /* ELF linker hash table entries. */ struct elf_link_hash_entry @@ -178,8 +187,8 @@ struct elf_link_hash_entry unsigned int needs_plt : 1; /* Symbol appears in a non-ELF input file. */ unsigned int non_elf : 1; - /* Symbol should be marked as hidden in the version information. */ - unsigned int hidden : 1; + /* Symbol version information. */ + ENUM_BITFIELD (elf_symbol_version) versioned : 2; /* Symbol was forced to local scope due to a version script file. */ unsigned int forced_local : 1; /* Symbol was forced to be dynamic due to a version script file. */ |