mirror of
https://github.com/kelvinlawson/atomthreads.git
synced 2026-01-21 15:23:14 +01:00
ARM/IntegratorCP: Use the same heap linker pointers whether using hosted/newlib or standalone toolchain.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user