maximilian attems
2011-Feb-16 23:06 UTC
[klibc] fwd: fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr'.
hello vorlon, got notified of your patch, will apply next days upstream unless some critiques are voiced on ml. thanks. -- maks ----- Forwarded message from Steve Langasek <steve.langasek at canonical.com> ----- Date: Wed, 16 Feb 2011 22:05:42 -0000 From: Steve Langasek <steve.langasek at canonical.com> Subject: [Bug 527720] Re: thumb2 porting issues identified: klibc uses mov.*pc I've also touched it up to be mergeable with Debian (support v4t builds with #ifdef). Confirmed that installing the resulting klibc packages on my beagleboard gives me a successfully-booting initramfs with klibc; and the vfork/setjmptest test cases all pass in the klibc package tree. Fixes: https://bugs.launchpad.net/ubuntu/+source/klibc/+bug/527720 --- klibc-1.5.20.orig/usr/klibc/arch/arm/vfork.S +++ klibc-1.5.20/usr/klibc/arch/arm/vfork.S @@ -25,7 +25,11 @@ vfork: ldrcs r3, 1f mvncs r0, #0 strcs r2, [r3] +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) mov pc, lr +#else + bx lr +#endif .balign 4 1: @@ -49,7 +53,11 @@ vfork: str r2, [r1] neg r0, r0 1: +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) mov pc, lr +#else + bx lr +#endif .balign 4 2: --- klibc-1.5.20.orig/usr/klibc/arch/arm/setjmp.S +++ klibc-1.5.20/usr/klibc/arch/arm/setjmp.S @@ -29,7 +29,11 @@ setjmp: stmia r0, {r4, r5, r6, r7, r8, r9, r10, fp, sp, lr} mov r0, #0 +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) mov pc, lr +#else + bx lr +#endif .size setjmp,.-setjmp .text @@ -39,7 +43,11 @@ setjmp: longjmp: ldmia r0, {r4, r5, r6, r7, r8, r9, r10, fp, sp, lr} mov r0, r1 +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) mov pc, lr +#else + bx lr +#endif .size longjmp,.-longjmp #else /* __thumb__ */ @@ -75,7 +83,11 @@ setjmp: mov r7, sp stmia r0!, {r3, r4, r5, r6, r7} mov r0, #0 +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) mov pc, lr +#else + bx lr +#endif .size setjmp,.-setjmp .text @@ -96,7 +108,11 @@ longjmp: mov r0, r1 bne 1f mov r0, #1 +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) 1: mov pc, r3 +#else +1: bx r3 +#endif .size longjmp,.-longjmp #endif /* __thumb__ */
Kirill A. Shutemov
2011-Feb-16 23:50 UTC
[klibc] fwd: fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr'.
On Thu, Feb 17, 2011 at 12:06:48AM +0100, maximilian attems wrote:> hello vorlon, > > got notified of your patch, > will apply next days upstream unless some critiques are voiced on ml. > thanks. > > -- > maks > > > ----- Forwarded message from Steve Langasek <steve.langasek at canonical.com> ----- > > Date: Wed, 16 Feb 2011 22:05:42 -0000 > From: Steve Langasek <steve.langasek at canonical.com> > Subject: [Bug 527720] Re: thumb2 porting issues identified: klibc uses mov.*pc > > > I've also touched it up to be mergeable with Debian (support v4t builds > with #ifdef). > > Confirmed that installing the resulting klibc packages on my beagleboard > gives me a successfully-booting initramfs with klibc; and the > vfork/setjmptest test cases all pass in the klibc package tree. > > Fixes: https://bugs.launchpad.net/ubuntu/+source/klibc/+bug/527720 > > --- klibc-1.5.20.orig/usr/klibc/arch/arm/vfork.S > +++ klibc-1.5.20/usr/klibc/arch/arm/vfork.S > @@ -25,7 +25,11 @@ vfork: > ldrcs r3, 1f > mvncs r0, #0 > strcs r2, [r3] > +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__)NAK. ARMv4T supports bx intruction. ARMv4 doesn't.> mov pc, lr > +#else > + bx lr > +#endif > > .balign 4 > 1: > @@ -49,7 +53,11 @@ vfork: > str r2, [r1] > neg r0, r0 > 1: > +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) > mov pc, lr > +#else > + bx lr > +#endif > > .balign 4 > 2: > --- klibc-1.5.20.orig/usr/klibc/arch/arm/setjmp.S > +++ klibc-1.5.20/usr/klibc/arch/arm/setjmp.S > @@ -29,7 +29,11 @@ > setjmp: > stmia r0, {r4, r5, r6, r7, r8, r9, r10, fp, sp, lr} > mov r0, #0 > +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) > mov pc, lr > +#else > + bx lr > +#endif > .size setjmp,.-setjmp > > .text > @@ -39,7 +43,11 @@ setjmp: > longjmp: > ldmia r0, {r4, r5, r6, r7, r8, r9, r10, fp, sp, lr} > mov r0, r1 > +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) > mov pc, lr > +#else > + bx lr > +#endif > .size longjmp,.-longjmp > > #else /* __thumb__ */ > @@ -75,7 +83,11 @@ setjmp: > mov r7, sp > stmia r0!, {r3, r4, r5, r6, r7} > mov r0, #0 > +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) > mov pc, lr > +#else > + bx lr > +#endif > .size setjmp,.-setjmp > > .text > @@ -96,7 +108,11 @@ longjmp: > mov r0, r1 > bne 1f > mov r0, #1 > +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) > 1: mov pc, r3 > +#else > +1: bx r3 > +#endif > .size longjmp,.-longjmp > > #endif /* __thumb__ */ > > _______________________________________________ > klibc mailing list > klibc at zytor.com > http://www.zytor.com/mailman/listinfo/klibc-- Kirill A. Shutemov
Khem Raj
2011-Feb-17 00:03 UTC
[klibc] fwd: fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr'.
On Wed, Feb 16, 2011 at 3:50 PM, Kirill A. Shutemov <kirill at shutemov.name> wrote:> On Thu, Feb 17, 2011 at 12:06:48AM +0100, maximilian attems wrote: >> hello vorlon, >> >> got notified of your patch, >> will apply next days upstream unless some critiques are voiced on ml. >> thanks. >> >> -- >> maks >> >> >> ----- Forwarded message from Steve Langasek <steve.langasek at canonical.com> ----- >> >> Date: Wed, 16 Feb 2011 22:05:42 -0000 >> From: Steve Langasek <steve.langasek at canonical.com> >> Subject: [Bug 527720] Re: thumb2 porting issues identified: klibc uses mov.*pc >> >> >> I've also touched it up to be mergeable with Debian (support v4t builds >> with #ifdef). >> >> Confirmed that installing the resulting klibc packages on my beagleboard >> gives me a successfully-booting initramfs with klibc; and the >> vfork/setjmptest test cases all pass in the klibc package tree. >> >> Fixes: https://bugs.launchpad.net/ubuntu/+source/klibc/+bug/527720 >> >> --- klibc-1.5.20.orig/usr/klibc/arch/arm/vfork.S >> +++ klibc-1.5.20/usr/klibc/arch/arm/vfork.S >> @@ -25,7 +25,11 @@ vfork: >> ? ? ? ? ?ldrcs ? ? ? ?r3, 1f >> ? ? ? ? ?mvncs ? ? ? ?r0, #0 >> ? ? ? ? ?strcs ? ? ? ?r2, [r3] >> +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) > > NAK. ARMv4T supports bx intruction. ARMv4 doesn't.Does ARMv4t support BX lr ?> >> ? ? ? mov ? ? pc, lr >> +#else >> + ? ? bx ? ? ?lr >> +#endif >> >> ? ? ? .balign 4 >> ?1: >> @@ -49,7 +53,11 @@ vfork: >> ? ? ? str ? ? r2, [r1] >> ? ? ? neg ? ? r0, r0 >> ?1: >> +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) >> ? ? ? mov ? ? pc, lr >> +#else >> + ? ? bx ? ? ?lr >> +#endif >> >> ? ? ? .balign 4 >> ?2: >> --- klibc-1.5.20.orig/usr/klibc/arch/arm/setjmp.S >> +++ klibc-1.5.20/usr/klibc/arch/arm/setjmp.S >> @@ -29,7 +29,11 @@ >> ?setjmp: >> ? ? ? stmia ? r0, {r4, r5, r6, r7, r8, r9, r10, fp, sp, lr} >> ? ? ? mov ? ? r0, #0 >> +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) >> ? ? ? mov ? ? pc, lr >> +#else >> + ? ? bx ? ? ?lr >> +#endif >> ? ? ? .size setjmp,.-setjmp >> >> ? ? ? .text >> @@ -39,7 +43,11 @@ setjmp: >> ?longjmp: >> ? ? ? ldmia ? r0, {r4, r5, r6, r7, r8, r9, r10, fp, sp, lr} >> ? ? ? mov ? ? r0, r1 >> +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) >> ? ? ? mov ? ? pc, lr >> +#else >> + ? ? bx ? ? ?lr >> +#endif >> ? ? ? .size longjmp,.-longjmp >> >> ?#else /* __thumb__ */ >> @@ -75,7 +83,11 @@ setjmp: >> ? ? ? mov ? ? r7, sp >> ? ? ? stmia ? r0!, {r3, r4, r5, r6, r7} >> ? ? ? mov ? ? r0, #0 >> +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) >> ? ? ? mov ? ? pc, lr >> +#else >> + ? ? bx ? ? ?lr >> +#endif >> ? ? ? .size setjmp,.-setjmp >> >> ? ? ? .text >> @@ -96,7 +108,11 @@ longjmp: >> ? ? ? mov ? ? r0, r1 >> ? ? ? bne ? ? 1f >> ? ? ? mov ? ? r0, #1 >> +#if defined (___ARM_ARCH_4T__) || defined (__ARM_ARCH_4__) >> ?1: ? mov ? ? pc, r3 >> +#else >> +1: ? bx ? ? ?r3 >> +#endif >> ? ? ? .size longjmp,.-longjmp >> >> ?#endif /* __thumb__ */ >> >> _______________________________________________ >> klibc mailing list >> klibc at zytor.com >> http://www.zytor.com/mailman/listinfo/klibc > > -- > ?Kirill A. Shutemov > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel at lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel >
Apparently Analagous Threads
- [PATCH] arm: use bx on thumb2 v3
- [klibc 22/43] arm support for klibc
- Bug#622814: klibc: patch to make klcc play nice with multiarch linux-libc-dev
- [klibc 00/31] klibc as a historyless patchset (updated and reorganized)
- [LLVMdev] Lowering "memcpy" intrinsic function on ARM using LDMIA/STMIA