This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: __cxa_atexit question
Ulrich Drepper wrote:
> Mark Mitchell wrote:
>> Many of these systems use static linking, and there the compiler driver
>> puts the C++ runtime before the C runtime library.
>
> This is/was about hpux. One can safely assume almost no code is using
> static linking. And if it is not used having two competing
> implementations can be really bad.
It is partly about HP-UX. It is more generally about whether or not to
have system-specific functionality in libstdc++ required to support C++,
even if that functionality is not part of the C++ ABI, or is provided by
the C library on GNU/Linux.
On HP-UX, specifically, the proprietary HP-UX C++ compiler provides a
C++ runtime library which includes atexit and __cxa_atexit, but the GNU
C++ runtime library does not. So, things work better with the
proprietary compiler than with the GNU compiler.
I do not know what (or if) system-specific tricks are used to make sure
that the libCsup.so version of atexit is used instead of the libc.so
version when a C shared library is incorporated into a C++ application.
However, I do see that atexit is reported as WEAK PROTECTED by readelf
in libc, and as GLOBAL DEFAULT in libCsup. Perhaps Steve can tell us
exactly what is being done.
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713