diff options
author | Ian Lance Taylor <ian@airs.com> | 2010-01-12 06:41:36 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 2010-01-12 06:41:36 +0000 |
commit | b3d58323640bd007c4bc7957afc6887fa3d6e060 (patch) | |
tree | 6847f1310649311e009e3cb60122fc078c59a382 /gold/dynobj.cc | |
parent | 10572cc141c72892f8ae287b806daa10582ca916 (diff) | |
download | binutils-redhat-b3d58323640bd007c4bc7957afc6887fa3d6e060.tar.gz |
* script.cc (class Lazy_demangler): Recreate--revert part of patch
of 2009-12-30.
(Version_script_info::Version_script_info): Initialize globs_,
default_version_, default_is_global_, and exact_. Don't
initialize globals_ or locals_.
(Version_script_info::build_lookup_tables): Build local symbols
first.
(Version_script_info::unquote): New function.
(Version_script_info::add_exact_match): New function.
(Version_script_info::build_expression_list_lookup): Remove lookup
parameter. Add is_global parameter. Change all callers. Handle
wildcard pattern specially. Unquote pattern. Call
add_exact_match.
(Version_script_info::get_name_to_match): New function.
(Version_script_info::get_symbol_version): New function.
(Version_script_info::get_symbol_version_helper): Remove.
(Version_script_info::check_unmatched_names): Call unquote.
* script.h (class Version_script_info): Change get_symbol_version
to be non-inline and add is_global parameter; change all callers.
Rewrite symbol_is_local. Update declarations. Define struct
Version_tree_match, Exact, Globs. Don't define struct Lookup.
Remove globals_ and locals_ members. Add exact_, globs_,
default_version_, is_global_.
(Version_script_info::Glob): Remove pattern, add expression and
is_global. Update constructor. Change all callers.
* dynobj.cc (Versions::finalize): Mark the version symbol as the
default version.
(Versions::symbol_section_contents): If a symbol is undefined, or
defined in a dynamic object, set the version index to
VER_NDX_LOCAL.
* symtab.cc (Symbol_table::add_from_relobj): Don't call
symbol_is_local.
(Symbol_table::add_from_pluginobj): Likewise.
* testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
Diffstat (limited to 'gold/dynobj.cc')
-rw-r--r-- | gold/dynobj.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gold/dynobj.cc b/gold/dynobj.cc index 86668fb083..dc6b009f49 100644 --- a/gold/dynobj.cc +++ b/gold/dynobj.cc @@ -1560,6 +1560,7 @@ Versions::finalize(Symbol_table* symtab, unsigned int dynsym_index, false, false); vsym->set_needs_dynsym_entry(); vsym->set_dynsym_index(dynsym_index); + vsym->set_is_default(); ++dynsym_index; syms->push_back(vsym); // The name is already in the dynamic pool. @@ -1649,10 +1650,15 @@ Versions::symbol_section_contents(const Symbol_table* symtab, { unsigned int version_index; const char* version = (*p)->version(); - if (version == NULL) - version_index = elfcpp::VER_NDX_GLOBAL; - else + if (version != NULL) version_index = this->version_index(symtab, dynpool, *p); + else + { + if ((*p)->is_defined() && !(*p)->is_from_dynobj()) + version_index = elfcpp::VER_NDX_GLOBAL; + else + version_index = elfcpp::VER_NDX_LOCAL; + } // If the symbol was defined as foo@V1 instead of foo@@V1, add // the hidden bit. if ((*p)->version() != NULL && !(*p)->is_default()) |