All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] arm: Add ENTRY/ENDPROC to private libgcc functions
@ 2015-06-02 17:08 Simon Glass
  2015-06-02 17:08 ` [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary" Simon Glass
  2015-07-01 14:11 ` [U-Boot] [PATCH 1/2] arm: Add ENTRY/ENDPROC to private libgcc functions Albert ARIBAUD
  0 siblings, 2 replies; 9+ messages in thread
From: Simon Glass @ 2015-06-02 17:08 UTC (permalink / raw)
  To: u-boot

When CONFIG_SYS_THUMB_BUILD is defined these functions may be called from
Thumb code. Add the required ENTRY and ENDPROC bracketing so that BLX is
used to call these ARM functions, instead of plain BL, which will fail.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Pavel Machek <pavel@denx.de>
---

 arch/arm/lib/_ashldi3.S |  6 ++++--
 arch/arm/lib/_ashrdi3.S |  6 ++++--
 arch/arm/lib/_divsi3.S  |  6 ++++--
 arch/arm/lib/_lshrdi3.S |  6 ++++--
 arch/arm/lib/_modsi3.S  |  7 ++++---
 arch/arm/lib/_udivsi3.S | 10 ++++++----
 arch/arm/lib/_umodsi3.S |  6 ++++--
 7 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/arch/arm/lib/_ashldi3.S b/arch/arm/lib/_ashldi3.S
index 2c26f84..9c34c21 100644
--- a/arch/arm/lib/_ashldi3.S
+++ b/arch/arm/lib/_ashldi3.S
@@ -4,6 +4,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
+#include <linux/linkage.h>
+
 #ifdef __ARMEB__
 #define al r1
 #define ah r0
@@ -13,9 +15,8 @@
 #endif
 
 .globl __ashldi3
-.globl	__aeabi_llsl
 __ashldi3:
-__aeabi_llsl:
+ENTRY(__aeabi_llsl)
 
 	subs	r3, r2, #32
 	rsb	ip, r2, #32
@@ -24,3 +25,4 @@ __aeabi_llsl:
 	orrmi	ah, ah, al, lsr ip
 	mov	al, al, lsl r2
 	mov	pc, lr
+ENDPROC(__aeabi_llsl)
diff --git a/arch/arm/lib/_ashrdi3.S b/arch/arm/lib/_ashrdi3.S
index 4d93c8a..c74fd64 100644
--- a/arch/arm/lib/_ashrdi3.S
+++ b/arch/arm/lib/_ashrdi3.S
@@ -4,6 +4,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
+#include <linux/linkage.h>
+
 #ifdef __ARMEB__
 #define al r1
 #define ah r0
@@ -13,9 +15,8 @@
 #endif
 
 .globl __ashrdi3
-.globl __aeabi_lasr
 __ashrdi3:
-__aeabi_lasr:
+ENTRY(__aeabi_lasr)
 
 	subs	r3, r2, #32
 	rsb	ip, r2, #32
@@ -24,3 +25,4 @@ __aeabi_lasr:
 	orrmi	al, al, ah, lsl ip
 	mov	ah, ah, asr r2
 	mov	pc, lr
+ENDPROC(__aeabi_lasr)
diff --git a/arch/arm/lib/_divsi3.S b/arch/arm/lib/_divsi3.S
index 6015493..c463c68 100644
--- a/arch/arm/lib/_divsi3.S
+++ b/arch/arm/lib/_divsi3.S
@@ -1,3 +1,5 @@
+#include <linux/linkage.h>
+
 .macro ARM_DIV_BODY dividend, divisor, result, curbit
 
 #if __LINUX_ARM_ARCH__ >= 5
@@ -95,9 +97,8 @@
 
 	.align	5
 .globl __divsi3
-.globl __aeabi_idiv
 __divsi3:
-__aeabi_idiv:
+ENTRY(__aeabi_idiv)
 	cmp	r1, #0
 	eor	ip, r0, r1			@ save the sign of the result.
 	beq	Ldiv0
@@ -139,3 +140,4 @@ Ldiv0:
 	bl	__div0
 	mov	r0, #0			@ About as wrong as it could be.
 	ldr	pc, [sp], #4
+ENDPROC(__aeabi_idiv)
diff --git a/arch/arm/lib/_lshrdi3.S b/arch/arm/lib/_lshrdi3.S
index 33296a0..1f9b916 100644
--- a/arch/arm/lib/_lshrdi3.S
+++ b/arch/arm/lib/_lshrdi3.S
@@ -4,6 +4,8 @@
  * SPDX-License-Identifier:	GPL-2.0+
  */
 
+#include <linux/linkage.h>
+
 #ifdef __ARMEB__
 #define al r1
 #define ah r0
@@ -13,9 +15,8 @@
 #endif
 
 .globl __lshrdi3
-.globl __aeabi_llsr
 __lshrdi3:
-__aeabi_llsr:
+ENTRY(__aeabi_llsr)
 
 	subs	r3, r2, #32
 	rsb	ip, r2, #32
@@ -24,3 +25,4 @@ __aeabi_llsr:
 	orrmi	al, al, ah, lsl ip
 	mov	ah, ah, lsr r2
 	mov	pc, lr
+ENDPROC(__aeabi_llsr)
diff --git a/arch/arm/lib/_modsi3.S b/arch/arm/lib/_modsi3.S
index 3d31a55..c5e1c22 100644
--- a/arch/arm/lib/_modsi3.S
+++ b/arch/arm/lib/_modsi3.S
@@ -1,3 +1,5 @@
+#include <linux/linkage.h>
+
 .macro ARM_MOD_BODY dividend, divisor, order, spare
 
 #if __LINUX_ARM_ARCH__ >= 5
@@ -69,8 +71,7 @@
 .endm
 
 	.align	5
-.globl __modsi3
-__modsi3:
+ENTRY(__modsi3)
 	cmp	r1, #0
 	beq	Ldiv0
 	rsbmi	r1, r1, #0			@ loops below use unsigned.
@@ -88,7 +89,7 @@ __modsi3:
 10:	cmp	ip, #0
 	rsbmi	r0, r0, #0
 	mov	pc, lr
-
+ENDPROC(__modsi3)
 
 Ldiv0:
 
diff --git a/arch/arm/lib/_udivsi3.S b/arch/arm/lib/_udivsi3.S
index 1309802..3b653be 100644
--- a/arch/arm/lib/_udivsi3.S
+++ b/arch/arm/lib/_udivsi3.S
@@ -1,3 +1,5 @@
+#include <linux/linkage.h>
+
 /* # 1 "libgcc1.S" */
 @ libgcc1 routines for ARM cpu.
 @ Division routines, written by Richard Earnshaw, (rearnsha at armltd.co.uk)
@@ -72,8 +74,7 @@ Ldiv0:
 	ldmia	sp!, {pc}
 	.size  __udivsi3       , . -  __udivsi3
 
-.globl __aeabi_uidivmod
-__aeabi_uidivmod:
+ENTRY(__aeabi_uidivmod)
 
 	stmfd	sp!, {r0, r1, ip, lr}
 	bl	__aeabi_uidiv
@@ -81,9 +82,9 @@ __aeabi_uidivmod:
 	mul	r3, r0, r2
 	sub	r1, r1, r3
 	mov	pc, lr
+ENDPROC(__aeabi_uidivmod)
 
-.globl __aeabi_idivmod
-__aeabi_idivmod:
+ENTRY(__aeabi_idivmod)
 
 	stmfd	sp!, {r0, r1, ip, lr}
 	bl	__aeabi_idiv
@@ -91,3 +92,4 @@ __aeabi_idivmod:
 	mul	r3, r0, r2
 	sub	r1, r1, r3
 	mov	pc, lr
+ENDPROC(__aeabi_idivmod)
diff --git a/arch/arm/lib/_umodsi3.S b/arch/arm/lib/_umodsi3.S
index 8465ef0..b166737 100644
--- a/arch/arm/lib/_umodsi3.S
+++ b/arch/arm/lib/_umodsi3.S
@@ -1,3 +1,5 @@
+#include <linux/linkage.h>
+
 /* # 1 "libgcc1.S" */
 @ libgcc1 routines for ARM cpu.
 @ Division routines, written by Richard Earnshaw, (rearnsha at armltd.co.uk)
@@ -11,10 +13,9 @@ curbit		.req	r3
 /* lr		.req	r14	*/
 /* pc		.req	r15	*/
 	.text
-	.globl	 __umodsi3
 	.type  __umodsi3       ,function
 	.align 0
- __umodsi3      :
+ ENTRY(__umodsi3)
 	cmp	divisor, #0
 	beq	Ldiv0
 	mov	curbit, #1
@@ -86,3 +87,4 @@ Ldiv0:
 /* # 456 "libgcc1.S" */
 /* # 500 "libgcc1.S" */
 /* # 580 "libgcc1.S" */
+ENDPROC(__umodsi3)
-- 
2.2.0.rc0.207.ga3a616c

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

* [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary"
  2015-06-02 17:08 [U-Boot] [PATCH 1/2] arm: Add ENTRY/ENDPROC to private libgcc functions Simon Glass
@ 2015-06-02 17:08 ` Simon Glass
  2015-06-02 17:13   ` Tom Rini
  2015-07-01 14:11   ` Albert ARIBAUD
  2015-07-01 14:11 ` [U-Boot] [PATCH 1/2] arm: Add ENTRY/ENDPROC to private libgcc functions Albert ARIBAUD
  1 sibling, 2 replies; 9+ messages in thread
From: Simon Glass @ 2015-06-02 17:08 UTC (permalink / raw)
  To: u-boot

The root cause of this problem should now be fixed.

This reverts commit a6a4c542d316b3401f0840ac5378743191bca851.
Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/arm/include/asm/u-boot.h | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/arm/include/asm/u-boot.h b/arch/arm/include/asm/u-boot.h
index ae4c21b..43cc494 100644
--- a/arch/arm/include/asm/u-boot.h
+++ b/arch/arm/include/asm/u-boot.h
@@ -49,8 +49,4 @@ typedef struct bd_info {
 #define IH_ARCH_DEFAULT IH_ARCH_ARM64
 #endif
 
-#if defined(CONFIG_USE_PRIVATE_LIBGCC) && defined(CONFIG_SYS_THUMB_BUILD)
-#error Thumb build does not work with private libgcc.
-#endif
-
 #endif	/* _U_BOOT_H_ */
-- 
2.2.0.rc0.207.ga3a616c

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

* [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary"
  2015-06-02 17:08 ` [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary" Simon Glass
@ 2015-06-02 17:13   ` Tom Rini
  2015-06-03  7:18     ` Pavel Machek
  2015-07-01 14:11   ` Albert ARIBAUD
  1 sibling, 1 reply; 9+ messages in thread
From: Tom Rini @ 2015-06-02 17:13 UTC (permalink / raw)
  To: u-boot

On Tue, Jun 02, 2015 at 11:08:21AM -0600, Simon Glass wrote:

> The root cause of this problem should now be fixed.
> 
> This reverts commit a6a4c542d316b3401f0840ac5378743191bca851.
> Signed-off-by: Simon Glass <sjg@chromium.org>

Thanks for digging into all of this!  Pavel, can you confirm that with
these two applied things work still?  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150602/e37153a2/attachment.sig>

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

* [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary"
  2015-06-02 17:13   ` Tom Rini
@ 2015-06-03  7:18     ` Pavel Machek
  2015-07-01 13:37       ` Albert ARIBAUD
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Machek @ 2015-06-03  7:18 UTC (permalink / raw)
  To: u-boot

On Tue 2015-06-02 13:13:05, Tom Rini wrote:
> On Tue, Jun 02, 2015 at 11:08:21AM -0600, Simon Glass wrote:
> 
> > The root cause of this problem should now be fixed.
> > 
> > This reverts commit a6a4c542d316b3401f0840ac5378743191bca851.
> > Signed-off-by: Simon Glass <sjg@chromium.org>
> 
> Thanks for digging into all of this!  Pavel, can you confirm that with
> these two applied things work still?  Thanks!

For series:

Acked-by: Pavel Machek <pavel@denx.de>
Tested-by: Pavel Machek <pavel@denx.de>

Thanks,
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary"
  2015-06-03  7:18     ` Pavel Machek
@ 2015-07-01 13:37       ` Albert ARIBAUD
  2015-07-01 13:54         ` Tom Rini
  2015-07-01 13:54         ` Pavel Machek
  0 siblings, 2 replies; 9+ messages in thread
From: Albert ARIBAUD @ 2015-07-01 13:37 UTC (permalink / raw)
  To: u-boot

Hello Pavel,

On Wed, 3 Jun 2015 09:18:12 +0200, Pavel Machek <pavel@denx.de> wrote:
> On Tue 2015-06-02 13:13:05, Tom Rini wrote:
> > On Tue, Jun 02, 2015 at 11:08:21AM -0600, Simon Glass wrote:
> > 
> > > The root cause of this problem should now be fixed.
> > > 
> > > This reverts commit a6a4c542d316b3401f0840ac5378743191bca851.
> > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > 
> > Thanks for digging into all of this!  Pavel, can you confirm that with
> > these two applied things work still?  Thanks!
> 
> For series:
> 
> Acked-by: Pavel Machek <pavel@denx.de>
> Tested-by: Pavel Machek <pavel@denx.de>

Do we consider this a bug fix? If so, I can add this series it to my
ARM PR (along with Masahiro's 'enable CONFIG_USE_PRIVATE_LIBGCC by
default' which was clashing with (here reverted) a6a4c542d.

> Thanks,

Amicalement,
-- 
Albert.

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

* [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary"
  2015-07-01 13:37       ` Albert ARIBAUD
@ 2015-07-01 13:54         ` Tom Rini
  2015-07-01 13:54         ` Pavel Machek
  1 sibling, 0 replies; 9+ messages in thread
From: Tom Rini @ 2015-07-01 13:54 UTC (permalink / raw)
  To: u-boot

On Wed, Jul 01, 2015 at 03:37:15PM +0200, Albert ARIBAUD wrote:
> Hello Pavel,
> 
> On Wed, 3 Jun 2015 09:18:12 +0200, Pavel Machek <pavel@denx.de> wrote:
> > On Tue 2015-06-02 13:13:05, Tom Rini wrote:
> > > On Tue, Jun 02, 2015 at 11:08:21AM -0600, Simon Glass wrote:
> > > 
> > > > The root cause of this problem should now be fixed.
> > > > 
> > > > This reverts commit a6a4c542d316b3401f0840ac5378743191bca851.
> > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > 
> > > Thanks for digging into all of this!  Pavel, can you confirm that with
> > > these two applied things work still?  Thanks!
> > 
> > For series:
> > 
> > Acked-by: Pavel Machek <pavel@denx.de>
> > Tested-by: Pavel Machek <pavel@denx.de>
> 
> Do we consider this a bug fix? If so, I can add this series it to my
> ARM PR (along with Masahiro's 'enable CONFIG_USE_PRIVATE_LIBGCC by
> default' which was clashing with (here reverted) a6a4c542d.

Yes please, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150701/2d863193/attachment.sig>

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

* [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary"
  2015-07-01 13:37       ` Albert ARIBAUD
  2015-07-01 13:54         ` Tom Rini
@ 2015-07-01 13:54         ` Pavel Machek
  1 sibling, 0 replies; 9+ messages in thread
From: Pavel Machek @ 2015-07-01 13:54 UTC (permalink / raw)
  To: u-boot

On Wed 2015-07-01 15:37:15, Albert ARIBAUD wrote:
> Hello Pavel,
> 
> On Wed, 3 Jun 2015 09:18:12 +0200, Pavel Machek <pavel@denx.de> wrote:
> > On Tue 2015-06-02 13:13:05, Tom Rini wrote:
> > > On Tue, Jun 02, 2015 at 11:08:21AM -0600, Simon Glass wrote:
> > > 
> > > > The root cause of this problem should now be fixed.
> > > > 
> > > > This reverts commit a6a4c542d316b3401f0840ac5378743191bca851.
> > > > Signed-off-by: Simon Glass <sjg@chromium.org>
> > > 
> > > Thanks for digging into all of this!  Pavel, can you confirm that with
> > > these two applied things work still?  Thanks!
> > 
> > For series:
> > 
> > Acked-by: Pavel Machek <pavel@denx.de>
> > Tested-by: Pavel Machek <pavel@denx.de>
> 
> Do we consider this a bug fix? If so, I can add this series it to my
> ARM PR (along with Masahiro's 'enable CONFIG_USE_PRIVATE_LIBGCC by
> default' which was clashing with (here reverted) a6a4c542d.

I think fixing CONFIG_USE_PRIVATE_LIBGCC is a a bug fix, yes... :-).
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* [U-Boot] [PATCH 1/2] arm: Add ENTRY/ENDPROC to private libgcc functions
  2015-06-02 17:08 [U-Boot] [PATCH 1/2] arm: Add ENTRY/ENDPROC to private libgcc functions Simon Glass
  2015-06-02 17:08 ` [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary" Simon Glass
@ 2015-07-01 14:11 ` Albert ARIBAUD
  1 sibling, 0 replies; 9+ messages in thread
From: Albert ARIBAUD @ 2015-07-01 14:11 UTC (permalink / raw)
  To: u-boot

Hello Simon,

On Tue,  2 Jun 2015 11:08:20 -0600, Simon Glass <sjg@chromium.org> wrote:
> When CONFIG_SYS_THUMB_BUILD is defined these functions may be called from
> Thumb code. Add the required ENTRY and ENDPROC bracketing so that BLX is
> used to call these ARM functions, instead of plain BL, which will fail.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> Reported-by: Pavel Machek <pavel@denx.de>
> ---
> 
>  arch/arm/lib/_ashldi3.S |  6 ++++--
>  arch/arm/lib/_ashrdi3.S |  6 ++++--
>  arch/arm/lib/_divsi3.S  |  6 ++++--
>  arch/arm/lib/_lshrdi3.S |  6 ++++--
>  arch/arm/lib/_modsi3.S  |  7 ++++---
>  arch/arm/lib/_udivsi3.S | 10 ++++++----
>  arch/arm/lib/_umodsi3.S |  6 ++++--
>  7 files changed, 30 insertions(+), 17 deletions(-)

Applied to u-boot-arm/master, thanks!

Amicalement,
-- 
Albert.

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

* [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary"
  2015-06-02 17:08 ` [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary" Simon Glass
  2015-06-02 17:13   ` Tom Rini
@ 2015-07-01 14:11   ` Albert ARIBAUD
  1 sibling, 0 replies; 9+ messages in thread
From: Albert ARIBAUD @ 2015-07-01 14:11 UTC (permalink / raw)
  To: u-boot

Hello Simon,

On Tue,  2 Jun 2015 11:08:21 -0600, Simon Glass <sjg@chromium.org> wrote:
> The root cause of this problem should now be fixed.
> 
> This reverts commit a6a4c542d316b3401f0840ac5378743191bca851.
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  arch/arm/include/asm/u-boot.h | 4 ----
>  1 file changed, 4 deletions(-)

Applied to u-boot-arm/master, thanks!

Amicalement,
-- 
Albert.

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

end of thread, other threads:[~2015-07-01 14:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-02 17:08 [U-Boot] [PATCH 1/2] arm: Add ENTRY/ENDPROC to private libgcc functions Simon Glass
2015-06-02 17:08 ` [U-Boot] [PATCH 2/2] Revert "break build if it would produce broken binary" Simon Glass
2015-06-02 17:13   ` Tom Rini
2015-06-03  7:18     ` Pavel Machek
2015-07-01 13:37       ` Albert ARIBAUD
2015-07-01 13:54         ` Tom Rini
2015-07-01 13:54         ` Pavel Machek
2015-07-01 14:11   ` Albert ARIBAUD
2015-07-01 14:11 ` [U-Boot] [PATCH 1/2] arm: Add ENTRY/ENDPROC to private libgcc functions Albert ARIBAUD

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.