All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: fix compilation of entry-common.S for older CPUs
@ 2009-09-18 14:55 Dmitry Artamonow
  2009-09-18 16:27 ` Uwe Kleine-König
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Artamonow @ 2009-09-18 14:55 UTC (permalink / raw)
  To: linux-arm-kernel

Commit 181f817eaaca4c1f introduced some new code to entry-common.S
Sadly, this new code uses 'bx' instruction which is available only on
ARMv5 and higher CPUs. This causes following compilation errors when
building kernel for StrongARM (ARMv4):

arch/arm/kernel/entry-common.S: Assembler messages:
arch/arm/kernel/entry-common.S:129: Error: selected processor does not
 support `bx ip'
arch/arm/kernel/entry-common.S:138: Error: selected processor does not
 support `bx ip'

Fix these errors by using 'mov pc' instead of 'bx'.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
---
 arch/arm/kernel/entry-common.S |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Please note that I haven't tested this change on hardware as I don't
have needed toolchain (GCC 4.4+).

diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 807cfeb..825db52 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -126,7 +126,7 @@ ENTRY(__gnu_mcount_nc)
 	cmp r0, r2
 	bne gnu_trace
 	ldmia sp!, {r0-r3, ip, lr}
-	bx ip
+	mov pc, ip
 
 gnu_trace:
 	ldr r1, [sp, #20]			@ lr of instrumented routine
@@ -135,7 +135,7 @@ gnu_trace:
 	mov lr, pc
 	mov pc, r2
 	ldmia sp!, {r0-r3, ip, lr}
-	bx ip
+	mov pc, ip
 
 ENTRY(mcount)
 	stmdb sp!, {r0-r3, lr}
-- 
1.6.3.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] arm: fix compilation of entry-common.S for older CPUs
  2009-09-18 14:55 [PATCH] arm: fix compilation of entry-common.S for older CPUs Dmitry Artamonow
@ 2009-09-18 16:27 ` Uwe Kleine-König
  2009-09-28 19:41   ` Dmitry Artamonow
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2009-09-18 16:27 UTC (permalink / raw)
  To: linux-arm-kernel

Hello,

On Fri, Sep 18, 2009 at 06:55:45PM +0400, Dmitry Artamonow wrote:
> Commit 181f817eaaca4c1f introduced some new code to entry-common.S
> Sadly, this new code uses 'bx' instruction which is available only on
> ARMv5 and higher CPUs. This causes following compilation errors when
> building kernel for StrongARM (ARMv4):
> 
> arch/arm/kernel/entry-common.S: Assembler messages:
> arch/arm/kernel/entry-common.S:129: Error: selected processor does not
>  support `bx ip'
> arch/arm/kernel/entry-common.S:138: Error: selected processor does not
>  support `bx ip'
> 
> Fix these errors by using 'mov pc' instead of 'bx'.
> 
> Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>

I wonder if newer glibc's have the same problem as the code is taken
more or less from there ...

Thanks
Uwe

-- 
Pengutronix e.K.                              | Uwe Kleine-K?nig            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] arm: fix compilation of entry-common.S for older CPUs
  2009-09-18 16:27 ` Uwe Kleine-König
@ 2009-09-28 19:41   ` Dmitry Artamonow
  2009-09-28 22:34     ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Artamonow @ 2009-09-28 19:41 UTC (permalink / raw)
  To: linux-arm-kernel

On 18:27 Fri 18 Sep     , Uwe Kleine-K?nig wrote:
> Hello,
> 
> On Fri, Sep 18, 2009 at 06:55:45PM +0400, Dmitry Artamonow wrote:
> > Commit 181f817eaaca4c1f introduced some new code to entry-common.S
> > Sadly, this new code uses 'bx' instruction which is available only on
> > ARMv5 and higher CPUs. This causes following compilation errors when
> > building kernel for StrongARM (ARMv4):
> > 
> > arch/arm/kernel/entry-common.S: Assembler messages:
> > arch/arm/kernel/entry-common.S:129: Error: selected processor does not
> >  support `bx ip'
> > arch/arm/kernel/entry-common.S:138: Error: selected processor does not
> >  support `bx ip'
> > 
> > Fix these errors by using 'mov pc' instead of 'bx'.
> > 
> > Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
> Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> 
> I wonder if newer glibc's have the same problem as the code is taken
> more or less from there ...
> 
> Thanks
> Uwe

Russell, are you ok with this fix? Should I submit patch to your patch
tracker?

(It seems that first time around patch didn't get through to you, due to your
server being picky about SMTP servers without matching reverse DNS, so
in case you haven't seen the patch on the list, I'm attaching it here again)

-- 
Best regards,
Dmitry "MAD" Artamonow

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] arm: fix compilation of entry-common.S for older CPUs
  2009-09-28 19:41   ` Dmitry Artamonow
@ 2009-09-28 22:34     ` Russell King - ARM Linux
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2009-09-28 22:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Sep 28, 2009 at 11:41:22PM +0400, Dmitry Artamonow wrote:
> Russell, are you ok with this fix? Should I submit patch to your patch
> tracker?

Yes please.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] arm: fix compilation of entry-common.S for older CPUs
@ 2009-09-18 14:29 Dmitry Artamonow
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Artamonow @ 2009-09-18 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

Commit 181f817eaaca4c1f introduced some new code to entry-common.S
Sadly, this new code uses 'bx' instruction which is available only on
ARMv5 and higher CPUs. This causes following compilation errors when
building kernel for StrongARM (ARMv4):

arch/arm/kernel/entry-common.S: Assembler messages:
arch/arm/kernel/entry-common.S:129: Error: selected processor does not
 support `bx ip'
arch/arm/kernel/entry-common.S:138: Error: selected processor does not
 support `bx ip'

Fix these errors by using 'mov pc' instead of 'bx'.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
---
 arch/arm/kernel/entry-common.S |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Please note that I haven't tested this change on hardware as I don't
have needed toolchain (GCC 4.4+).

diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 807cfeb..825db52 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -126,7 +126,7 @@ ENTRY(__gnu_mcount_nc)
 	cmp r0, r2
 	bne gnu_trace
 	ldmia sp!, {r0-r3, ip, lr}
-	bx ip
+	mov pc, ip
 
 gnu_trace:
 	ldr r1, [sp, #20]			@ lr of instrumented routine
@@ -135,7 +135,7 @@ gnu_trace:
 	mov lr, pc
 	mov pc, r2
 	ldmia sp!, {r0-r3, ip, lr}
-	bx ip
+	mov pc, ip
 
 ENTRY(mcount)
 	stmdb sp!, {r0-r3, lr}
-- 
1.6.3.4


--envbJBWh7q8WU6mo--

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-09-28 22:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-18 14:55 [PATCH] arm: fix compilation of entry-common.S for older CPUs Dmitry Artamonow
2009-09-18 16:27 ` Uwe Kleine-König
2009-09-28 19:41   ` Dmitry Artamonow
2009-09-28 22:34     ` Russell King - ARM Linux
  -- strict thread matches above, loose matches on Subject: below --
2009-09-18 14:29 Dmitry Artamonow

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.