public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] AArch64 nosys still uses semihosing call
@ 2017-08-24  8:44 Alexander Fedotov
  2017-08-24 10:16 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Alexander Fedotov @ 2017-08-24  8:44 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 68 bytes --]

Move ILP32 code with AngelSVC call under ARM_RDI_MONITOR directive.

[-- Attachment #2: 0001-move-ILP32-sanity-check-on-heap-base-code-under-ARM_.patch --]
[-- Type: application/octet-stream, Size: 1083 bytes --]

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


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

* Re: [PATCH] AArch64 nosys still uses semihosing call
  2017-08-24  8:44 [PATCH] AArch64 nosys still uses semihosing call Alexander Fedotov
@ 2017-08-24 10:16 ` Corinna Vinschen
  2017-08-24 12:42   ` Tamar Christina
  0 siblings, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2017-08-24 10:16 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 229 bytes --]

On Aug 24 11:23, Alexander Fedotov wrote:
> Move ILP32 code with AngelSVC call under ARM_RDI_MONITOR directive.

Can we get some input from arm devs?


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* RE: [PATCH] AArch64 nosys still uses semihosing call
  2017-08-24 10:16 ` Corinna Vinschen
@ 2017-08-24 12:42   ` Tamar Christina
  2017-08-24 13:31     ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Tamar Christina @ 2017-08-24 12:42 UTC (permalink / raw)
  To: newlib; +Cc: nd



> -----Original Message-----
> From: newlib-owner@sourceware.org [mailto:newlib-
> owner@sourceware.org] On Behalf Of Corinna Vinschen
> Sent: 24 August 2017 09:50
> To: newlib@sourceware.org
> Subject: Re: [PATCH] AArch64 nosys still uses semihosing call
> 
> On Aug 24 11:23, Alexander Fedotov wrote:
> > Move ILP32 code with AngelSVC call under ARM_RDI_MONITOR directive.
> 
> Can we get some input from arm devs?
> 

This looks correct to me, as the nosys stuff only initialize the stack, aside from the semihosting calls
HeapBase won't be defined either without ARM_RDI_MONITOR, and even worse x0 is used uninitialized.

Likely it would just segfault at the moment with ILP32 without this patch. 

Thanks,
Tamar

> 
> Thanks,
> Corinna
> 
> --
> Corinna Vinschen
> Cygwin Maintainer
> Red Hat

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

* Re: [PATCH] AArch64 nosys still uses semihosing call
  2017-08-24 12:42   ` Tamar Christina
@ 2017-08-24 13:31     ` Corinna Vinschen
  0 siblings, 0 replies; 4+ messages in thread
From: Corinna Vinschen @ 2017-08-24 13:31 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 922 bytes --]

Hi Tamar,

On Aug 24 10:15, Tamar Christina wrote:
> 
> 
> > -----Original Message-----
> > From: newlib-owner@sourceware.org [mailto:newlib-
> > owner@sourceware.org] On Behalf Of Corinna Vinschen
> > Sent: 24 August 2017 09:50
> > To: newlib@sourceware.org
> > Subject: Re: [PATCH] AArch64 nosys still uses semihosing call
> > 
> > On Aug 24 11:23, Alexander Fedotov wrote:
> > > Move ILP32 code with AngelSVC call under ARM_RDI_MONITOR directive.
> > 
> > Can we get some input from arm devs?
> > 
> 
> This looks correct to me, as the nosys stuff only initialize the stack, aside from the semihosting calls
> HeapBase won't be defined either without ARM_RDI_MONITOR, and even worse x0 is used uninitialized.
> 
> Likely it would just segfault at the moment with ILP32 without this patch. 

Thanks for your input.  Patch pushed.


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2017-08-24 12:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-24  8:44 [PATCH] AArch64 nosys still uses semihosing call Alexander Fedotov
2017-08-24 10:16 ` Corinna Vinschen
2017-08-24 12:42   ` Tamar Christina
2017-08-24 13:31     ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).