[uClibc]Question on crt0.c for powerpc

Huy Nguyen huy at routefree.com
Fri May 17 04:40:21 UTC 2002


Hi,

Anybody understand the hack below? The one follows the comment gross hack
for dynamic linker.
I'm using yesterday snapshot of uclibc to build for powerpc. Program  that I
link shared against uclibc has been getting random segfault depending on how
many parameters the program is invoked with. I'm running on a 2.4.0 kernel.
I'm suspecting that the assumption of where the arguments are stored on the
stack is not correct. Any suggestion on where the problem might be?


void _start2(void)
{
        void **p;
        int argc;

        p=__builtin_frame_address(0)+0x30;

        argc=*(int *)p;

        /* gross hack for dynamic linker */
        if(argc==0){
                p=((void *)p)+0x10;
                argc=*(int *)p;
        }

        __uClibc_main(argc,p+1,p+2+argc);
}




More information about the uClibc mailing list