This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: gcc 3.0 missing __dso_handle in libstdc++
Andi Kleen wrote:
>
> I guess it's caused by the following in crtstuff.o:
>
> /* Declare the __dso_handle variable. It should have a unique value
> in every shared-object; in a main program its value is zero. The
> object should in any case be protected. This means the instance
> in one DSO or the main program is not used in another object. The
> dynamic linker takes care of this. */
>
> /* XXX Ideally the following should be implemented using
> __attribute__ ((__visibility__ ("hidden")))
> but the __attribute__ support is not yet there. */
> #ifdef HAVE_GAS_HIDDEN
> asm (".hidden\t__dso_handle");
> #endif
>
> #ifdef CRTSTUFFS_O
> void *__dso_handle = &__dso_handle;
> #else
> void *__dso_handle = 0;
> #endif
>
> but seems that doesn't work properly in glibc 2.1 and binutils 2.9.5.0 (hj lu versions I think)
> It may be a dynamic linker bug?
>
FWIW, I vaguely remember this problem was discussed earlier on some of the
gcc mailing lists, the outcome was that there is a bug in some specific versions of
binutils.