Skip to content

Commit a2beed3

Browse files
* 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.
1 parent 1a3fd26 commit a2beed3

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

gold/ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2010-01-08 Ian Lance Taylor <[email protected]>
2+
3+
* script.cc (Version_script_info::build_expression_list_lookup):
4+
Don't warn about ambiguous version, just record the ambiguity.
5+
(Version_script_info::get_symbol_version_helper): Give error if
6+
version is ambiguous.
7+
18
2010-01-08 Doug Kwan <[email protected]>
29

310
* arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,

gold/script.cc

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,11 +1957,13 @@ Version_script_info::build_expression_list_lookup(
19571957
if (!ins.second)
19581958
{
19591959
const Version_tree* v1 = ins.first->second;
1960-
if (v1->tag != v->tag)
1961-
gold_error(_("'%s' appears in version script with both "
1962-
"versions '%s' and '%s'"),
1963-
exp.pattern.c_str(), v1->tag.c_str(),
1964-
v->tag.c_str());
1960+
if (v1 != NULL && v1->tag != v->tag)
1961+
{
1962+
// This is an ambiguous match. It's OK if it's just
1963+
// documenting symbol versions, but not if we look
1964+
// up this symbol.
1965+
ins.first->second = NULL;
1966+
}
19651967
}
19661968
}
19671969
}
@@ -2037,7 +2039,16 @@ Version_script_info::get_symbol_version_helper(const char* symbol_name,
20372039
if (pe != lookup->exact.end())
20382040
{
20392041
if (pversion != NULL)
2040-
*pversion = pe->second->tag;
2042+
{
2043+
if (pe->second != NULL)
2044+
*pversion = pe->second->tag;
2045+
else
2046+
{
2047+
gold_error(_("'%s' has multiple versions in version script"),
2048+
name_to_match);
2049+
return false;
2050+
}
2051+
}
20412052

20422053
// If we are using --no-undefined-version, and this is a
20432054
// global symbol, we have to record that we have found this

0 commit comments

Comments
 (0)