GNOME Bugzilla – Bug 135274
underscore prefixed symbols exported on Linux
Last modified: 2011-02-04 16:16:03 UTC
This is a followup to the following gtk-devel-list thread: http://mail.gnome.org/archives/gtk-devel-list/2004-February/msg00127.html I've filed it as a GTK bug, but it also affects ATK, Pango and Glib. Currently, the restriction on export of underscore prefixed symbols is not functioning correctly on Linux, even when libtool has a working -export-symbols implementation (ie. 1.5.2 or older versions with the expsym-linux patch). This problem seems to be that the linker ignores the -version-script option when it also sees --export-dynamic. The flags output by "pkg-config --libs gmodule-2.0" include -Wl,--export-dynamic so libtool will pass the flag through without checking it. Unless I am mistaken, there isn't any case where you would need to use --export-dynamic when linking a shared library. Its usual purpose is to export the symbols from a normal executable. Since this is done by default for a shared library it shouldn't be needed, and in fact seems to be harmful in this case. The solution to the problem is to remove the flag from the link line. I posted a simplistic patch to gtk-devel-list to do this (will attach it to this bug report shortly), but the eventual fix might be to remove the flag from gmodule-2.0's libs list.
Created attachment 24715 [details] [review] export-dynamic.patch
Looks good to commit if you add a comment describing why we are doing this.
Committed the change, and also in Pango. Wed Mar 3 16:00:10 2004 Owen Taylor <otaylor@redhat.com> * configure.in: Strip out the "export-dynamic" libtool option from library link lines. (#124687, James Henstridge)