This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [AArch64] nosys still uses semihosing call


I propose following patch.

Alex

On Tue, Aug 22, 2017 at 3:56 PM, Alexander Fedotov <alfedotov@gmail.com> wrote:
> In crt0.S we have some code under __ILP32__ that uses AngelSVCAsm AngelSVC.
> But for nosys it is incorrect even if ARM_RDI_MONITOR is not defined.
>
>
> Alex



-- 
Best regards,
AF
From d73c070f3b72d5dcd45506425c7548ce9142e732 Mon Sep 17 00:00:00 2001
From: Alexander Fedotov-B55613 <b55613@freescale.com>
Date: Tue, 22 Aug 2017 17:06:54 +0300
Subject: [PATCH] move ILP32 sanity check on heap base code under
 ARM_RDI_MONITOR

---
 libgloss/aarch64/crt0.S | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libgloss/aarch64/crt0.S b/libgloss/aarch64/crt0.S
index 4ad435e..f670e03 100644
--- a/libgloss/aarch64/crt0.S
+++ b/libgloss/aarch64/crt0.S
@@ -101,10 +101,7 @@
 	   exposed here in the HeapInfo Angel call.  */
 	ldr	x0, .LC0		/* point at returned values */
 	ldr	x1, [x0, #8]		/* get heap_limit */
-#else
-	/* Set up the stack pointer to a fixed value.  */
-	ldr     x1, .Lstack
-#endif
+
 #ifdef __ILP32__
 	/* Sanity check on the heap base.  */
 	ldr	x0, [x0]		/* get heap_base */
@@ -128,6 +125,10 @@
 	tst	x1, #0xffffffff00000000
 	csinv	w1, w1, wzr, eq
 #endif
+#else
+	/* Set up the stack pointer to a fixed value.  */
+	ldr     x1, .Lstack
+#endif
 
 	/* Ensure quad-word stack alignment.  */
 	and	x0, x1, #~15
-- 
2.7.4


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]