* fwd: [klibc] fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr'.
@ 2011-02-16 23:06 maximilian attems
2011-02-16 23:50 ` [klibc] fwd: " Kirill A. Shutemov
0 siblings, 1 reply; 8+ messages in thread
From: maximilian attems @ 2011-02-16 23:06 UTC (permalink / raw)
To: linux-arm-kernel
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@canonical.com> -----
Date: Wed, 16 Feb 2011 22:05:42 -0000
From: Steve Langasek <steve.langasek@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__ */
^ permalink raw reply [flat|nested] 8+ messages in thread* [klibc] fwd: fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr'.
2011-02-16 23:06 fwd: [klibc] fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr' maximilian attems
@ 2011-02-16 23:50 ` Kirill A. Shutemov
2011-02-17 0:01 ` Steve Langasek
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Kirill A. Shutemov @ 2011-02-16 23:50 UTC (permalink / raw)
To: linux-arm-kernel
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@canonical.com> -----
>
> Date: Wed, 16 Feb 2011 22:05:42 -0000
> From: Steve Langasek <steve.langasek@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
^ permalink raw reply [flat|nested] 8+ messages in thread* [klibc] fwd: fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr'.
2011-02-16 23:50 ` [klibc] fwd: " Kirill A. Shutemov
@ 2011-02-17 0:01 ` Steve Langasek
2011-02-17 0:18 ` Kirill A. Shutemov
2011-02-17 0:03 ` Khem Raj
2011-02-17 9:39 ` Dave Martin
2 siblings, 1 reply; 8+ messages in thread
From: Steve Langasek @ 2011-02-17 0:01 UTC (permalink / raw)
To: linux-arm-kernel
Thanks for forwarding this on, maks.
On Thu, Feb 17, 2011 at 01:50:19AM +0200, Kirill A. Shutemov wrote:
> > Date: Wed, 16 Feb 2011 22:05:42 -0000
> > From: Steve Langasek <steve.langasek@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.
I see from
https://wiki.ubuntu.com/ARM/Thumb2PortingHowto#Identifying%20the%20Target%20Architecture
that you are correct - but then in
https://wiki.ubuntu.com/ARM/Thumb2PortingHowto#Detailed%20Instruction%20Behaviour
the recommendation given is to use exactly this guard for backwards
compatibility.
I'm cc:ing Dave Martin from ARM who drafted this porting guide. Dave, was
there some other reason besides instruction compatibility to prefer the
original "mov pc,lr" on armv4t, or is this simply a miscopy?
> > mov pc, lr
> > +#else
> > + bx lr
> > +#endif
Thanks,
--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
slangasek at ubuntu.com vorlon at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110216/ff3d096d/attachment.sig>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [klibc] fwd: fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr'.
2011-02-17 0:01 ` Steve Langasek
@ 2011-02-17 0:18 ` Kirill A. Shutemov
0 siblings, 0 replies; 8+ messages in thread
From: Kirill A. Shutemov @ 2011-02-17 0:18 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Feb 16, 2011 at 04:01:44PM -0800, Steve Langasek wrote:
> Thanks for forwarding this on, maks.
>
> On Thu, Feb 17, 2011 at 01:50:19AM +0200, Kirill A. Shutemov wrote:
> > > Date: Wed, 16 Feb 2011 22:05:42 -0000
> > > From: Steve Langasek <steve.langasek@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.
>
> I see from
> https://wiki.ubuntu.com/ARM/Thumb2PortingHowto#Identifying%20the%20Target%20Architecture
> that you are correct - but then in
> https://wiki.ubuntu.com/ARM/Thumb2PortingHowto#Detailed%20Instruction%20Behaviour
> the recommendation given is to use exactly this guard for backwards
> compatibility.
glibc-ports:
sysdeps/arm/sysdep.h:
#if (!defined (__ARM_ARCH_2__) && !defined (__ARM_ARCH_3__) \
&& !defined (__ARM_ARCH_3M__) && !defined (__ARM_ARCH_4__))
# define __USE_BX__
#endif
sysdeps/arm/dl-machine.h:
#if defined(__USE_BX__)
#define BX(x) "bx\t" #x
#else
#define BX(x) "mov\tpc, " #x
#endif
>
> I'm cc:ing Dave Martin from ARM who drafted this porting guide. Dave, was
> there some other reason besides instruction compatibility to prefer the
> original "mov pc,lr" on armv4t, or is this simply a miscopy?
>
> > > mov pc, lr
> > > +#else
> > > + bx lr
> > > +#endif
>
> Thanks,
> --
> Steve Langasek Give me a lever long enough and a Free OS
> Debian Developer to set it on, and I can move the world.
> Ubuntu Developer http://www.debian.org/
> slangasek at ubuntu.com vorlon at debian.org
--
Kirill A. Shutemov
^ permalink raw reply [flat|nested] 8+ messages in thread
* [klibc] fwd: fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr'.
2011-02-16 23:50 ` [klibc] fwd: " Kirill A. Shutemov
2011-02-17 0:01 ` Steve Langasek
@ 2011-02-17 0:03 ` Khem Raj
2011-02-17 0:42 ` Kirill A. Shutemov
2011-02-17 3:17 ` Khem Raj
2011-02-17 9:39 ` Dave Martin
2 siblings, 2 replies; 8+ messages in thread
From: Khem Raj @ 2011-02-17 0:03 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Feb 16, 2011 at 3:50 PM, Kirill A. Shutemov
<kirill@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@canonical.com> -----
>>
>> Date: Wed, 16 Feb 2011 22:05:42 -0000
>> From: Steve Langasek <steve.langasek@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
>
^ permalink raw reply [flat|nested] 8+ messages in thread* [klibc] fwd: fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr'.
2011-02-17 0:03 ` Khem Raj
@ 2011-02-17 0:42 ` Kirill A. Shutemov
2011-02-17 3:17 ` Khem Raj
1 sibling, 0 replies; 8+ messages in thread
From: Kirill A. Shutemov @ 2011-02-17 0:42 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Feb 16, 2011 at 04:03:07PM -0800, Khem Raj wrote:
> On Wed, Feb 16, 2011 at 3:50 PM, Kirill A. Shutemov
> <kirill@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@canonical.com> -----
> >>
> >> Date: Wed, 16 Feb 2011 22:05:42 -0000
> >> From: Steve Langasek <steve.langasek@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 ?
Sure.
See http://wiki.debian.org/ArmEabiPort
--
Kirill A. Shutemov
^ permalink raw reply [flat|nested] 8+ messages in thread
* [klibc] fwd: fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr'.
2011-02-17 0:03 ` Khem Raj
2011-02-17 0:42 ` Kirill A. Shutemov
@ 2011-02-17 3:17 ` Khem Raj
1 sibling, 0 replies; 8+ messages in thread
From: Khem Raj @ 2011-02-17 3:17 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Feb 16, 2011 at 4:03 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Wed, Feb 16, 2011 at 3:50 PM, Kirill A. Shutemov
> <kirill@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@canonical.com> -----
>>>
>>> Date: Wed, 16 Feb 2011 22:05:42 -0000
>>> From: Steve Langasek <steve.langasek@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 ?
hmm yes it does. I confused it with blx <Rm> which is unpredictable in
thumb mode on architectures < armv5t
>
>
>>
>>> ? ? ? 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
>>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* [klibc] fwd: fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr'.
2011-02-16 23:50 ` [klibc] fwd: " Kirill A. Shutemov
2011-02-17 0:01 ` Steve Langasek
2011-02-17 0:03 ` Khem Raj
@ 2011-02-17 9:39 ` Dave Martin
2 siblings, 0 replies; 8+ messages in thread
From: Dave Martin @ 2011-02-17 9:39 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Feb 16, 2011 at 11:50 PM, Kirill A. Shutemov
<kirill@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@canonical.com> -----
>>
>> Date: Wed, 16 Feb 2011 22:05:42 -0000
>> From: Steve Langasek <steve.langasek@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.
>
You're strictly correct. My original rationale was to ensure there is
no disruption for people building for v4/v4T -- since the more
restricted functionality of Thumb-1 means people tend not to use it to
build the whole distro anyway.
If people using <v5 are prepared to accept the change, I've got no
problem with changing the #ifs to #ifdef __ARM_ARCH_4__
We can't get rid of the #ifdef though, unless we can persuade everyone
targeting v4 to build with gcc/as -march=armv4t + ld --fix-v4bx
(unlikely).
Cheers
---Dave
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-02-17 9:39 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-16 23:06 fwd: [klibc] fix up ARM assembly to use 'bx lr' in place of 'mov pc, lr' maximilian attems
2011-02-16 23:50 ` [klibc] fwd: " Kirill A. Shutemov
2011-02-17 0:01 ` Steve Langasek
2011-02-17 0:18 ` Kirill A. Shutemov
2011-02-17 0:03 ` Khem Raj
2011-02-17 0:42 ` Kirill A. Shutemov
2011-02-17 3:17 ` Khem Raj
2011-02-17 9:39 ` Dave Martin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox