bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/13245] PREVAILING_DEF reported too often.


From: ccoutant at google dot com
Subject: [Bug gold/13245] PREVAILING_DEF reported too often.
Date: Mon, 03 Oct 2011 21:50:21 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=13245

--- Comment #9 from Cary Coutant <ccoutant at google dot com> 2011-10-03 
21:50:21 UTC ---
> Here the function test is comdat both in libt.so and t2.so. 
> In t2.so we would like to make it static because doing so improves dynamic
> linking time (i.e. the function in question don't need to be resolved at all).
> We can't want to do that in libt.so because that one is not LTOed.
> 
> This would happen if linker returned PREVAILING_DEF_IRONLY_EXP for _Z4testv
> instead of PREVAILING_DEF.  I think this is consistent with documentation of 
> it
> - i.e. symbol is IRONLY within current DSO but exported. It does not matter
> much whether we know if libt.so will bind to it or not.

So do you want the linker to ignore references from shared objects completely,
or only if the reference is a (pre-empted) definition? I could make the former
happen with the following patch:

diff --git a/gold/resolve.cc b/gold/resolve.cc
index 03288ec..2a68876 100644
--- a/gold/resolve.cc
+++ b/gold/resolve.cc
@@ -296,7 +296,7 @@ Symbol_table::resolve(Sized_symbol<size>* to,

   // Record if we've seen this symbol in a real ELF object (i.e., the
   // symbol is referenced from outside the world known to the plugin).
-  if (object->pluginobj() == NULL)
+  if (object->pluginobj() == NULL && !object->is_dynamic())
     to->set_in_real_elf();

   // If we're processing replacement files, allow new symbols to override

That would be consistent with your view that linking with -lt should give the
same results as without -lt.

For the latter, I'd just have to add a test for whether or not the "from"
symbol is a definition.

-cary

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]