busybox segfault in __uClibc_main
Joakim Tjernlund
joakim.tjernlund at transmode.se
Mon Dec 12 09:06:57 UTC 2005
>
> On Sun, 11 Dec 2005, Joakim Tjernlund wrote:
>
> >
> > >
> > > On Sun, 11 Dec 2005, Joakim Tjernlund wrote:
> > >
> > > > >
> > > > > Joakim Tjernlund <joakim.tjernlund at transmode.se> wrote:
> > > > > >
> > > > > > Curious, does replacing r7 with r9 in
> > > > > > lwz r7,_NIP(r1)
> > > > > > lwz r8,_MSR(r1)
> > > > > > FIX_SRR1(r8, r0)
> > > > > > lwz r2,GPR2(r1)
> > > > > > lwz r1,GPR1(r1)
> > > > > > mtspr SPRN_SRR0,r7
> > > > > > mtspr SPRN_SRR1,r8
> > > > > > SYNC
> > > > > > RFI
> > > > > > work for you?
> > > > >
> > > > > I'm at home atm, but I'm damned sure it would work.
> > > >
> > > > hmm, one could also fix it in __uClibc_main() by addin
> > > #ifdef SHARED
> > > > .. #endif, not tested
> > > >
> > > > #ifdef SHARED
> > > > __rtld_fini = rtld_fini;
> > > > #endif
> > > >
> > > > will probably only work on current svn, not on .28
> > >
> > > can this somehow be checked on other arch as well?
> >
> > Don't quite understand, the above code covers all archs. What else
> > needs to be checked?
>
> I have thought that the failure exhibits only on ppc
As far as I know, yes. You mean that that the above #ifdef SHARED should
depend and PPC as well?
Maybe, I am not sure yet.
>
> >
> > > I am sure that __uClibc_main "offers" more places that
> can be guarded w/ SHARED
> >
> > Well, one could eliminate __rtld_fini completely.
> >
> > Can't rember now, are there 2 versions of crt1, one for
> shared and one for static that
> > lives side by side? if so one can force rtld_fini to zero
> in the static one.
>
> no, there is only one crt1.o both for static and for "normal"
> binaries,
> the other one (Scrt1.o) is only for ET_DYN/PIE.
OK, thanks.
>
> Peter
More information about the uClibc
mailing list