__cxa_atexit and __cxa_finalize implementation
Peter S. Mazinger
ps.m at gmx.net
Thu Sep 15 23:20:02 UTC 2005
On Thu, 15 Sep 2005, Stephen Warren wrote:
> Peter S. Mazinger wrote:
> > On Thu, 15 Sep 2005, Stephen Warren wrote:
> >
> >>Peter S. Mazinger wrote:
> >>
> >>>>>Please redo your patch as follows:
> >>>>>1. the functions that have to go into *libc_nonshared.a should be in
> >>>>>separate objects (ifdef L_* is ok, if you use the same source)
> >>>>>2. for hiding use attribute_hidden (it takes care of the case that gcc
> >>>>>does not support it, then it becomes visible)
> >>>>
> >>>>Sounds great. I'll try to work on this soon:-)
> >>
> >>Found a few minutes during a build. Attached is the latest patch.
> >>
> >>Item 1 on your list was already in place - libc/stdlib/atexit.o wants to
> >>go in the new .a file. (This comes from libc/stdlib/atexit.c with
> >>L_atexit defined). Everything else built from that .c file can go in
> >>"libc.so"
> >
> > should atexit.o go also into libc.so or only into nonshared.a?
> > (if libc uses it itself, then it should also go into libc.so)
>
> grep says libc.so doesn't use atexit internally, except for possibly
> some stuff in these files
>
> libc/sysdeps/linux/m68k/crt0.S
> libc/sysdeps/linux/h8300/crt0.S
> libc/sysdeps/linux/nios/crt0.c (same stuff, but commented)
those are obsolete w/ 0.9.28, only crt1.S is used (but as of my
knowledge only arm/i386/mips/ppc/x86-64 are done).
I will do a build test w/ your patch (atexit won't go to libc.so)
Thanks, Peter
>
> For example (from 68k):
>
> /*
> * this was needed for gcc/g++-builds, atexit was not getting included
> * for some stupid reason, this gets us a compiler
> */
> empty_func:
> rts
> #if defined(__HAVE_ELF__)
> .weak atexit
> atexit = empty_func
> #else
> .set atexit,empty_func
> #endif
>
> I have no idea what this does or why!
>
--
Peter S. Mazinger <ps dot m at gmx dot net> ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08 BB6E C389 975E A5F0 59F2
More information about the uClibc
mailing list