[uClibc] RE: [uClibc-cvs] svn commit: trunk/uClibc/ldso/ldso:armcris i386 m68k mips powerpc sh sh64 etc...

Joakim Tjernlund joakim.tjernlund at lumentis.se
Thu Mar 17 08:49:24 UTC 2005


> 
> On Wednesday 16 March 2005 03:12 am, Joakim Tjernlund wrote:
> > --- ldso.c	(revision 10024)
> > +	extern void _start(void);
> > +	if (_start == (void *) auxvt[AT_ENTRY].a_un.a_fcn) {
> > +		_dl_dprintf(2, "Standalone exection is not supported yet\n");
> > +		_dl_exit(1);
> > +	}
> 
> on a pedantic/ansi/whatever compiler this will fail ... for example, gcc-2.x 
> refuses to compile this due to the extern define being in the middle of scope

Yes, I will move that it upwards, outside the function.

> 
> > --- m68k/dl-startup.h	(revision 10024)
> > +#if 0
> > +/* This assembly should be fixed to relaced the alias below */
> > +asm(
> > +    "	.text\n"
> > +    "	.globl	_start\n"
> > +    "	.type	_start, at function\n"
> > +    "_start:\n"
> > +jmp	_dl_start
> > +    "	.size	_start,.-_start\n"
> > +    "	.previous\n"
> > +);
> 
> typo in the middle of this (the jmp line) ... missing quotes, new line, etc...

It is not a typo, it is incomlete as i didn't know enough assembler :)
Thats whay I added the strong_alias(..) below, but that didn't work.

Now I have 2 possible fixes:
#if 1
asm(
    "	.text\n"
    "	.globl	_start\n"
    "	.type	_start, at function\n"
    "_start:\n"
    "	.set	_start,_dl_start\n"
    "	.size	_start,.-_start\n"
    "	.previous\n"
);
#else
static void * _dl_start(unsigned long args);
extern  void _start(void) __attribute__ ((alias ("_dl_start")));
#endif

The extern  void _start(void) __attribute__ ((alias ("_dl_start"))); is ugly,
I hope that the new ASM above will do.
i386, sparc and m68k all has the same code here, so I hope if it works for one of
them, it will work for all of them.

 Jocke
> 
> > +#else
> > +static void * _dl_start(unsigned long args);
> > +strong_alias(_dl_start, _start);
> > +#endif
> 
> a gcc-2.x compiler rejects this because the prototype for _start() here is 
> different from what is used in the extern in ldso.c
> -mike
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://uclibc.org/mailman/listinfo/uclibc



More information about the uClibc mailing list