From: SourceForge.net <no...@so...> - 2010-09-13 14:47:31
|
Bugs item #3064962, was opened at 2010-09-13 01:06 Message generated for change (Comment added) made by nijtmans You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3064962&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 53. Configuration and Build Tools Group: None Status: Open Resolution: None Priority: 9 Private: No Submitted By: Alexandre Ferrieux (ferrieux) Assigned to: Jan Nijtmans (nijtmans) Summary: Suboptimal linkage of stubbed functions Initial Comment: When looking in detail at the native code generated by gcc on x86, one sees that stubbed functions, that get the EXTERN class (extern + attribute(visibility=default)), are _always_ called through the PLT (program linkage table), doing an unwanted indirection with possible strong cache misses. I don't know why it is so, because the build system uses -fvisibility=hidden, so that all those symbols should stay hidden and avoid the PLT. But the net result is a very measurable performance hit, as illustrated by in the tclcore discussion http://code.activestate.com/lists/tcl-core/9531/ ---------------------------------------------------------------------- >Comment By: Jan Nijtmans (nijtmans) Date: 2010-09-13 16:47 Message: Relevant here is Kevin's remark: <http://code.activestate.com/lists/tcl-core/9542/> and <http://software.intel.com/en-us/articles/performance-tools-for-software-developers-bsymbolic-can-cause-dangerous-side-effects/> (Thanks, Kevin!) I would be in favour of adding -Wl,-Bsymbolic to tcl.m4/configure: - Only in the release build - Only when linking the shared library, not in static builds. - Only with the GNU linker Reason: - On Windows, this is the default, multiple dll's using the same symbols, result in multiple versions of the same symbol. Tcl doesn't have this problem, simply because it doesn't export data, only function symbols. And if some application would use this 'feature', it is non-portable because it wouldn't work on Windows. I'll see if I can prepare a patch, before deciding on this. (B.T.W., I don't think this is actually a Bug.....) ---------------------------------------------------------------------- Comment By: Alexandre Ferrieux (ferrieux) Date: 2010-09-13 10:17 Message: Update: it's no longer mysterious, "visibility=default" meaning "not hidden". But the issue remains, and as kbk suggests the fix could very well be the -Bdynamic linker option. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3064962&group_id=10894 |