diff options
author | Nick Clifton <nickc@redhat.com> | 2011-09-29 11:23:29 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2011-09-29 11:23:29 +0000 |
commit | 5b495afe51c1edee5c7f38e259b0c8f587572e17 (patch) | |
tree | 8cd28fa86ff9753aadc6e68181a48475dcb7b0e2 | |
parent | 29deef8805ffa069090f191a22ec7538649cd70f (diff) | |
download | newlib-5b495afe51c1edee5c7f38e259b0c8f587572e17.zip newlib-5b495afe51c1edee5c7f38e259b0c8f587572e17.tar.gz newlib-5b495afe51c1edee5c7f38e259b0c8f587572e17.tar.bz2 |
* arm/crt0.s: Support 0 heap base response from HeapInfo syscall.
-rw-r--r-- | libgloss/ChangeLog | 4 | ||||
-rw-r--r-- | libgloss/arm/crt0.S | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/libgloss/ChangeLog b/libgloss/ChangeLog index afea6bb..ff129e6 100644 --- a/libgloss/ChangeLog +++ b/libgloss/ChangeLog @@ -1,3 +1,7 @@ +2011-09-29 Matthew Gretton-Dann <matthew.gretton-dann@arm.com> + + * arm/crt0.s: Support 0 heap base response from HeapInfo syscall. + 2011-09-29 Bin Cheng <bin.cheng@arm.com> * arm/arm.h (HAVE_CALL_INDIRECT): Define. diff --git a/libgloss/arm/crt0.S b/libgloss/arm/crt0.S index 7489850..101041e 100644 --- a/libgloss/arm/crt0.S +++ b/libgloss/arm/crt0.S @@ -86,6 +86,17 @@ AngelSWIAsm AngelSWI_ARM #endif ldr r0, .LC0 /* point at values read */ + + ldr r1, [r0, #0] + cmp r1, #0 + bne .LC32 + /* If the heap base value [r0, #0] is 0 then the heap base is actually + at the end of program data (i.e. __end__). See: + http://infocenter.arm.com/help/topic/com.arm.doc.dui0471-/Bacbefaa.html + for more information. */ + ldr r1, .LC31 + str r1, [r0, #0] +.LC32: ldr r1, [r0, #8] ldr r2, [r0, #12] /* We skip setting sp/sl if 0 returned from semihosting. @@ -437,6 +448,8 @@ change_back: .LC30: .word CommandLine .word 255 +.LC31: + .word __end__ /* Workspace for Angel calls. */ .data |