[uClibc] [RFC] [PATCH] Pass main function ptr from crtX.o to libc
Joakim Tjernlund
Joakim.Tjernlund at lumentis.se
Sat May 21 21:56:48 UTC 2005
>
> On Fri May 20, 2005 at 06:20:03PM +0200, Joakim Tjernlund wrote:
> > This patch passes the main functin ptr from crtX.o to __uClibc_start_main as a
> > function ptr instead of referencing main directly in __uClibc_start_main.
> >
> > This is cleaner solution that also will enable libc to be linked with -z defs. However the
> > patch breaks ABI, but since we are breaking ABI anyway with the new FINI handling it might
> > be a good idea to do this change as well.
> >
> > Patch also aligns the stack ptr to 16-byte boundary.
> > Now would also be a good time to kill __uClibc_main and related code in crtX.
> >
> > I can do x86 amd PowerPC.
> >
> > Comments?
>
> I think we should just go ahead and check this in. This also has
> the secondary advantage of making our crt0 pretty much identical
> to start.S from glibc... Making it easier to swipe code and get
> new arches going.
>
> -Erik
I have checked in this change in SVN and enabled the new FINI processing.
The old __uClibc_main has been removed.
Only x86 and PowerPC has been adapted to the new i/f.
The other archs need to:
Pass main and ldso fini function ptr to __uClibc_start_main from crt1.S
Pass ldso fini function ptr to crt1.S from ldso.
Align stack ptr in crt1.S to whatever alignment required by the arch.
Don't forget to copy the *crt1.o files to staging_dir/lib before relinking the apps.
Good luck
Jocke
More information about the uClibc
mailing list