G++ Linking issue : hidden symbol `__dso_handle'

Ian Lance Taylor iant@google.com
Thu Oct 8 21:44:00 GMT 2009


Rajat <myself_rajat@yahoo.com> writes:

> As you said, "That means that it can only be referenced from within the executable, not from a shared library." 
>
> So it seems this symbol is being referenced in crtbegin.o. If so then how to aviod it?

crtbegin.o is defining the symbol __dso_handle.  Some shared library
is referring to the symbol __dso_handle.  That reference shouldn't be
coming from crtbegin.o--crtbegin.o should define the symbol.  Where is
the reference?  The linker error message doesn't say.

Ian

> ----- Original Message ----
> From: Ian Lance Taylor <iant@google.com>
> To: Rajat <myself_rajat@yahoo.com>
> Sent: Wed, September 23, 2009 11:13:22 AM
> Subject: Re: G++ Linking issue : hidden symbol `__dso_handle'
>
> Rajat <myself_rajat@yahoo.com> writes:
>
>> But it seems linker is not able to resolve this symbol, defined in crtbegin.o .
>>
>> /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
>
> Please reply to the mailing list, not just to me.
>
> As the error message says, the symbol is marked as hidden in crtbegin.o.
> That means that it can only be referenced from within the executable,
> not from a shared library.



More information about the Gcc-help mailing list