aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2010-01-09 05:49:57 +0000
committerIan Lance Taylor <ian@airs.com>2010-01-09 05:49:57 +0000
commita2beed37dbcc39524abf8a86b2133ea49f766205 (patch)
tree1d54e8ecdb5a00af099755f476dfd09bc879a0f4
parent1a3fd2625dfe77dd577ff402e8f6c7c8596ec10a (diff)
downloadgdb-a2beed37dbcc39524abf8a86b2133ea49f766205.zip
gdb-a2beed37dbcc39524abf8a86b2133ea49f766205.tar.gz
gdb-a2beed37dbcc39524abf8a86b2133ea49f766205.tar.bz2
* script.cc (Version_script_info::build_expression_list_lookup):
Don't warn about ambiguous version, just record the ambiguity. (Version_script_info::get_symbol_version_helper): Give error if version is ambiguous.
-rw-r--r--gold/ChangeLog7
-rw-r--r--gold/script.cc23
2 files changed, 24 insertions, 6 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 18a465b..a92796a 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-08 Ian Lance Taylor <iant@google.com>
+
+ * script.cc (Version_script_info::build_expression_list_lookup):
+ Don't warn about ambiguous version, just record the ambiguity.
+ (Version_script_info::get_symbol_version_helper): Give error if
+ version is ambiguous.
+
2010-01-08 Doug Kwan <dougkwan@google.com>
* arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
diff --git a/gold/script.cc b/gold/script.cc
index 4239040..ce06052 100644
--- a/gold/script.cc
+++ b/gold/script.cc
@@ -1957,11 +1957,13 @@ Version_script_info::build_expression_list_lookup(
if (!ins.second)
{
const Version_tree* v1 = ins.first->second;
- if (v1->tag != v->tag)
- gold_error(_("'%s' appears in version script with both "
- "versions '%s' and '%s'"),
- exp.pattern.c_str(), v1->tag.c_str(),
- v->tag.c_str());
+ if (v1 != NULL && v1->tag != v->tag)
+ {
+ // This is an ambiguous match. It's OK if it's just
+ // documenting symbol versions, but not if we look
+ // up this symbol.
+ ins.first->second = NULL;
+ }
}
}
}
@@ -2037,7 +2039,16 @@ Version_script_info::get_symbol_version_helper(const char* symbol_name,
if (pe != lookup->exact.end())
{
if (pversion != NULL)
- *pversion = pe->second->tag;
+ {
+ if (pe->second != NULL)
+ *pversion = pe->second->tag;
+ else
+ {
+ gold_error(_("'%s' has multiple versions in version script"),
+ name_to_match);
+ return false;
+ }
+ }
// If we are using --no-undefined-version, and this is a
// global symbol, we have to record that we have found this