From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Description of problem: If I create a simple shared object and then attempt to link with this I get : /usr/bin/ld: main: hidden symbol `__dso_handle' in /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/crtbegin.o is referenced by DSO gcc -c -fPIC libtest.cpp (simple class with just constructor) ld -shared -soname libtest.so.1 -o libtest.so.1.0 -lc libtest.o /sbin/ldconfig -v -n . ln -s libtest.so.1.0 libtest.so g++ -o main main.cpp -L. -ltest produces the error above. main.cpp is just :- #include "libtest.h" int main() { libtest mylib; } Version-Release number of selected component (if applicable): gcc-c++-3.2.3-18 How reproducible: Always Steps to Reproduce: 1. See description above Actual Results: Give the following error /usr/bin/ld: main: hidden symbol `__dso_handle' in /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/crtbegin.o is referenced by DSO Expected Results: No errors and the main excecutable should have been produced. Additional info: No special information. Reproduced on two different machines. Fully up2date as of 14:30 GMT 09/09/2003
The bug is in the way you're linking the shared library. Never ever invoke ld by hand unless you know exactly what consequences it has. gcc/g++ driver knows better what is needed. The shared library should have been linked with: g++ -shared -Wl,-soname,libtest.so.1 -o libtest.so.1.0 libtest.o
An errata has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2003-344.html