__cxa_atexit prototype

Martin von Loewis loewis at informatik.hu-berlin.de
Thu Dec 16 20:03:48 UTC 1999


>   The type of __cxa_atexit involves a type `dso_handle'.  This type is
>   undefined.  
> 
> Suggested Resolution:
> 
>   Replace all occurrences of this type with `void *'.

There is another issue here. I tried implementing this approach in
gcc, for x86 ELF32 (Linux in particular), and found it
unimplementable; maybe I was just stupid.

The problem was to get at the dso_handle, inside the object file for a
translation unit. Say, crtsomething.o exports a symbol __dso_handle,
whose address is passed to __cxa_atexit. One copy of crtsomething.o
gets linked into each DSO. Inside each translation unit, you want to
get at the address of the __dso_handle defined *in your own DSO*.  I
understand that -Bsymbolic does that, but requiring -Bsymbolic was
inacceptable. Does the base ABI offer a better mechanism?

Regards,
Martin





More information about the cxx-abi-dev mailing list