Don't handle every plugin symbol as defined.
authorRafael Ávila de Espíndola <rafael.espindola@gmail.com>
Thu, 3 Mar 2016 19:42:21 +0000 (14:42 -0500)
committerRafael Ávila de Espíndola <rafael.espindola@gmail.com>
Thu, 3 Mar 2016 20:16:52 +0000 (15:16 -0500)
Gold was fetching --start-lib/--end-lib members if that member defined
or used a currently undefined symbol.

gold/ChangeLog
gold/plugin.cc

index 2d8193a34a69e85b2e135516796be8515f78f4ca..ca90470d430808e84fc12c786cfe9d4cc3927fd1 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-03  Rafael Ávila de Espíndola <rafael.espindola@gmail.com>
+
+       * plugin.cc (do_should_include_member): Ignore LDPK_UNDEF and
+       LDPK_WEAKUNDEF symbols.
+
 2015-03-03  Evgenii Stepanov  <eugenis@google.com>
 
        * plugin.h (Pluginobj::get_symbol_resolution_info): Add version
index bb7d6b2606b0b64a60031933283b420267fda31c..026748f42076b59b5aa012a01cd3cb47f21f5da0 100644 (file)
@@ -1179,6 +1179,8 @@ Sized_pluginobj<size, big_endian>::do_should_include_member(
   for (int i = 0; i < this->nsyms_; ++i)
     {
       const struct ld_plugin_symbol& sym = this->syms_[i];
+      if (sym.def == LDPK_UNDEF || sym.def == LDPK_WEAKUNDEF)
+        continue;
       const char* name = sym.name;
       Symbol* symbol;
       Archive::Should_include t = Archive::should_include_member(symtab,