[PATCH] Semihosting fix for AArch64 when heapinfo is not provided by debugger

Tamar Christina Tamar.Christina@arm.com
Mon Oct 23 18:57:00 GMT 2017


Hi Alex,

In principle nothing against the patch. Just a comment

> diff --git a/libgloss/aarch64/crt0.S b/libgloss/aarch64/crt0.S
> index f670e03..f831be1 100644
> --- a/libgloss/aarch64/crt0.S
> +++ b/libgloss/aarch64/crt0.S
> @@ -102,33 +102,44 @@
>  	ldr	x0, .LC0		/* point at returned values */
>  	ldr	x1, [x0, #8]		/* get heap_limit */
>  
> +	/* Set __heap_limit.  */
> +#ifdef __ILP32__
> +	/* Sanity check on the __heap_limit.  */
> +	tst	x1, #0xffffffff00000000
> +	bne	.Linsanepar
> +#endif

if x1 is 0 it won't pass the first test in ILP32 and takes the branch,
I assume you intended it to fall through in that case? So I think this test
should be re-ordered.

> +	cmp     x1, xzr
> +	beq     .LC4
> +	adrp	x2, __heap_limit
> +	add	x2, x2, #:lo12:__heap_limit
> +	str     x1, [x2]
> +.LC4:

Thanks,
Tamar



> -----Original Message-----
> From: newlib-owner@sourceware.org [mailto:newlib-
> owner@sourceware.org] On Behalf Of Alexander Fedotov
> Sent: 19 October 2017 22:41
> To: newlib@sourceware.org
> Subject: Re: [PATCH] Semihosting fix for AArch64 when heapinfo is not
> provided by debugger
> 
> Any comments/thoughts on this patch ?
> It would be great to have this feature in newlib release version.
> 
> Alex
> 
> On Fri, 13 Oct 2017 at 12:16, Corinna Vinschen <vinschen@redhat.com>
> wrote:
> 
> > On Oct 11 14:57, Alexander Fedotov wrote:
> > > Use the same approach as in ARM port for case when Debugger not
> > > providing necessary info for semihosting.
> >
> > I'd like to see an ACK from some arm folks.
> >
> >
> > Thanks,
> > Corinna
> >
> > --
> > Corinna Vinschen
> > Cygwin Maintainer
> > Red Hat
> >
> --
> Best regards,
> AF


More information about the Newlib mailing list