Powerpc crt1.S change faulty

Rob Landley rob at landley.net
Thu Mar 29 16:53:16 UTC 2007


On Thursday 29 March 2007 4:05 am, Joakim Tjernlund wrote:
> Hi Rob
> 
> I saw your change to powerpc crt1.S and I don't agree with it.
> mr r8,r3 copies r3 to r8
> r8 needs to maps to rtld_fini in __uClibc_main and that maps to
> _dl_fini. Basically you have broken dynamic apps.

Sigh.  Ok.

What does the comment mean, then?

> For static apps NULL must be passed in r8 and currenly
> crt1.S relies on the kernel to zero r3(since r3 holds
> the return value of exec) before handing over user space.
> If this no longer is true we are in deep sh***
> 
> Can you check if r3 is zero in your kernel? what kernel version
> are you using? Are you using QEMU?

Yup.  I'm using qemu-ppc, and without this change a statically linked "hello 
world" segfaults on exit (but not on _exit()).  Lemme forward this message to 
the qemu list.

For reference, the change is:
http://uclibc.org/cgi-bin/viewcvs.cgi?rev=18270&view=rev

>    Jocke

Rob
-- 
Vista: Windows Millenium Second Edition



More information about the uClibc mailing list