G++ Linking issue : hidden symbol `__dso_handle'

Rajat myself_rajat@yahoo.com
Wed Sep 16 06:02:00 GMT 2009

Hi All,

I am facing some problem while creating a binary during its linking phase. It flashes something like this,

---------------------------------------------------------------------------------------------------------------------------------------------------------- /usr/bin/ld: <binary_name>: hidden symbol `__dso_handle' in /usr/lib/gcc/i386-redhat-linux/3.4.6/crtbegin.o is referenced by DSO
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status


However I read somewhere that, In such cases "You are linking against a shared library that was created incorrectly. With GCC 3.x this might happen if you create a SharedLibrary directly using ld -shared -o libfoo.so .... Instead, use g++ -shared -Wl,-soname,libfoo.so.1 -o libfoo.so ...".

But even if I create all the required .so with -Wl -shared option, I get this error.

Any help or pointer would be highly appreciated.

Thanks a lot.


More information about the Gcc-help mailing list