aboutsummaryrefslogtreecommitdiff
path: root/gold/symtab.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2010-01-12 06:41:36 +0000
committerIan Lance Taylor <ian@airs.com>2010-01-12 06:41:36 +0000
commit98e090bd1ff5b948db254f3b9be8794d5ca93d88 (patch)
treee31a7c860d743e4fc26a005273004c9c1129b0fe /gold/symtab.cc
parentb4ba55a1812c4bde23d52111e54d2b72a1ec4af1 (diff)
downloadgdb-98e090bd1ff5b948db254f3b9be8794d5ca93d88.zip
gdb-98e090bd1ff5b948db254f3b9be8794d5ca93d88.tar.gz
gdb-98e090bd1ff5b948db254f3b9be8794d5ca93d88.tar.bz2
* 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/symtab.cc')
-rw-r--r--gold/symtab.cc40
1 files changed, 21 insertions, 19 deletions
diff --git a/gold/symtab.cc b/gold/symtab.cc
index 92a91bc..c2a811f 100644
--- a/gold/symtab.cc
+++ b/gold/symtab.cc
@@ -1113,11 +1113,13 @@ Symbol_table::add_from_relobj(
// The symbol name did not have a version, but the
// version script may assign a version anyway.
std::string version;
- if (this->version_script_.get_symbol_version(name, &version))
+ bool is_global;
+ if (this->version_script_.get_symbol_version(name, &version,
+ &is_global))
{
- // The version can be empty if the version script is
- // only used to force some symbols to be local.
- if (!version.empty())
+ if (!is_global)
+ is_forced_local = true;
+ else if (!version.empty())
{
ver = this->namepool_.add_with_length(version.c_str(),
version.length(),
@@ -1126,8 +1128,6 @@ Symbol_table::add_from_relobj(
is_default_version = true;
}
}
- else if (this->version_script_.symbol_is_local(name))
- is_forced_local = true;
}
}
@@ -1232,11 +1232,13 @@ Symbol_table::add_from_pluginobj(
// The symbol name did not have a version, but the
// version script may assign a version anyway.
std::string version;
- if (this->version_script_.get_symbol_version(name, &version))
+ bool is_global;
+ if (this->version_script_.get_symbol_version(name, &version,
+ &is_global))
{
- // The version can be empty if the version script is
- // only used to force some symbols to be local.
- if (!version.empty())
+ if (!is_global)
+ is_forced_local = true;
+ else if (!version.empty())
{
ver = this->namepool_.add_with_length(version.c_str(),
version.length(),
@@ -1245,8 +1247,6 @@ Symbol_table::add_from_pluginobj(
is_default_version = true;
}
}
- else if (this->version_script_.symbol_is_local(name))
- is_forced_local = true;
}
}
@@ -1566,14 +1566,16 @@ Symbol_table::define_special_symbol(const char** pname, const char** pversion,
bool is_default_version = false;
if (*pversion == NULL)
{
- if (this->version_script_.get_symbol_version(*pname, &v))
+ bool is_global;
+ if (this->version_script_.get_symbol_version(*pname, &v, &is_global))
{
- if (!v.empty())
- *pversion = v.c_str();
-
- // If we get the version from a version script, then we are
- // also the default version.
- is_default_version = true;
+ if (is_global && !v.empty())
+ {
+ *pversion = v.c_str();
+ // If we get the version from a version script, then we
+ // are also the default version.
+ is_default_version = true;
+ }
}
}