ARM/IntegratorCP: Use the same heap linker pointers whether using hosted/newlib or standalone toolchain.

This commit is contained in:
Kelvin Lawson
2013-02-26 23:08:10 +00:00
parent 8e6270f30e
commit 05f391631c
2 changed files with 5 additions and 7 deletions

View File

@@ -55,12 +55,13 @@ int _read(int file, char *ptr, int len) {
char *heap_end = 0;
caddr_t _sbrk(int incr) {
extern char heap_low; /* Defined by the linker */
extern char end; /* Defined by the linker */
extern char heap_top; /* Defined by the linker */
static char *heap_end;
char *prev_heap_end;
if (heap_end == 0) {
heap_end = &heap_low;
heap_end = &end;
}
prev_heap_end = heap_end;

View File

@@ -57,11 +57,6 @@ SECTIONS
_end_bss = .;
__bss_end__ = . ;
. = ALIGN(8);
heap_low = .; /* for _sbrk */
. = . + 0x10000; /* 64kB of heap memory */
heap_top = .; /* for _sbrk */
. = ALIGN(256);
.stack : {
@@ -95,3 +90,5 @@ SECTIONS
__end__ = .;
_end = .;
PROVIDE(end = .);
heap_top = ORIGIN(sram) + LENGTH(sram) - 4;