aboutsummaryrefslogtreecommitdiff
path: root/gold/resolve.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>2010-01-11 05:44:04 +0000
committerIan Lance Taylor <ian@airs.com>2010-01-11 05:44:04 +0000
commit7198066bc1e788f08e3a3fd1435ea50a610b8999 (patch)
tree1537216c5465329ffd4a176eff392cbf660fc074 /gold/resolve.cc
parent6ae8025abbf2cc1e9cb87800c7371338e4cd67bf (diff)
downloadgdb-7198066bc1e788f08e3a3fd1435ea50a610b8999.zip
gdb-7198066bc1e788f08e3a3fd1435ea50a610b8999.tar.gz
gdb-7198066bc1e788f08e3a3fd1435ea50a610b8999.tar.bz2
* resolve.cc (Symbol_table::resolve): Add symbols to the list of
ODR candidates if only one is weak.
Diffstat (limited to 'gold/resolve.cc')
-rw-r--r--gold/resolve.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/gold/resolve.cc b/gold/resolve.cc
index 9a402f3..408e83b 100644
--- a/gold/resolve.cc
+++ b/gold/resolve.cc
@@ -342,13 +342,15 @@ Symbol_table::resolve(Sized_symbol<size>* to,
// reference, could be a One Definition Rule (ODR) violation --
// especially if the types or sizes of the references differ. We'll
// store such pairs and look them up later to make sure they
- // actually refer to the same lines of code. (Note: not all ODR
- // violations can be found this way, and not everything this finds
- // is an ODR violation. But it's helpful to warn about.)
+ // actually refer to the same lines of code. We also check
+ // combinations of weak and strong, which might occur if one case is
+ // inline and the other is not. (Note: not all ODR violations can
+ // be found this way, and not everything this finds is an ODR
+ // violation. But it's helpful to warn about.)
bool to_is_ordinary;
if (parameters->options().detect_odr_violations()
- && sym.get_st_bind() == elfcpp::STB_WEAK
- && to->binding() == elfcpp::STB_WEAK
+ && (sym.get_st_bind() == elfcpp::STB_WEAK
+ || to->binding() == elfcpp::STB_WEAK)
&& orig_st_shndx != elfcpp::SHN_UNDEF
&& to->shndx(&to_is_ordinary) != elfcpp::SHN_UNDEF
&& to_is_ordinary