This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: Semihosting fix
- From: David Hoover <spm2 at dangerous dot li>
- To: newlib at sourceware dot org
- Cc: Corinna Vinschen <vinschen at redhat dot com>
- Date: Thu, 21 Apr 2016 07:21:35 +0200
- Subject: Re: Semihosting fix
- Authentication-results: sourceware.org; auth=none
- References: <b6a12912506cd0c264cdf37e6bcbb845 at dangerous dot li> <20160420090932 dot GD24590 at calimero dot vinschen dot de>
Hi Corinna,
Here's the fixed patch. Thanks,
David
On 2016-04-20 11:09, Corinna Vinschen wrote:
Hi David,
On Apr 19 15:54, David Hoover wrote:
Hello,
Code was introduced in commit 8d98f956cc398d086794e19051c3380d599022da
that breaks semihosting for ARM Cortex targets running in many
environments.
[...]
diff --git a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S
index 7c662f9..b459e12 100644
--- a/libgloss/arm/crt0.S
+++ b/libgloss/arm/crt0.S
@@ -125,9 +125,11 @@
/* Set __heap_limit. */
ldr r1, [r0, #4]
+ cmp r1, #0
+ beq .LC33
ldr r2, =__heap_limit
str r1, [r2]
-
+.LC33:
ldr r1, [r0, #0]
cmp r1, #0
bne .LC32
Your patch doesn't apply cleanly because of TAB vs. SPC differences.
Can you please resend your patch with fixed formatting (git
format-patch
might help)?
Thanks,
Corinna
From 98b27b581b0ad563897587a094dfcabcd5fa00d4 Mon Sep 17 00:00:00 2001
From: David Hoover <spm2@dangerous.li>
Date: Thu, 21 Apr 2016 07:12:24 +0200
Subject: [PATCH] Fixed semihosting for ARM when heapinfo not provided by
debugger.
---
libgloss/arm/crt0.S | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S
index 7c662f9..35c306b 100644
--- a/libgloss/arm/crt0.S
+++ b/libgloss/arm/crt0.S
@@ -125,9 +125,11 @@
/* Set __heap_limit. */
ldr r1, [r0, #4]
+ cmp r1, #0
+ beq .LC33
ldr r2, =__heap_limit
str r1, [r2]
-
+.LC33:
ldr r1, [r0, #0]
cmp r1, #0
bne .LC32
--
1.8.4-rc3