* resolve.cc (Symbol_table::resolve): Add symbols to the list of
authorIan Lance Taylor <ian@airs.com>
Mon, 11 Jan 2010 05:44:04 +0000 (05:44 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 11 Jan 2010 05:44:04 +0000 (05:44 +0000)
ODR candidates if only one is weak.

gold/ChangeLog
gold/resolve.cc

index a92796ab8aa0200695015e31f884d9937e24c0d6..77df2b89d5e02bcb2670473ca6dff6c80a6ba838 100644 (file)
@@ -1,3 +1,8 @@
+2010-01-10  Ian Lance Taylor  <iant@google.com>
+
+       * resolve.cc (Symbol_table::resolve): Add symbols to the list of
+       ODR candidates if only one is weak.
+
 2010-01-08  Ian Lance Taylor  <iant@google.com>
 
        * script.cc (Version_script_info::build_expression_list_lookup):
index 9a402f39277e97ccb6da798691336ffc9b74663a..408e83becab97842543533d4f0820ac6326093b5 100644 (file)
@@ -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
This page took 0.029463 seconds and 4 git commands to generate.