From db3ca1f596b2566a8dc3b5e0acd21c987ee0a3be Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 5 Aug 2002 16:55:50 +0000 Subject: 2002-08-05 Joel Sherrill * startup/bspstart.c, startup/linkcmds: Per PR247 , fix the linkcmds to avoid overlapping sections and reworked the way the heap and workspace are calculated. --- c/src/lib/libbsp/h8300/h8sim/ChangeLog | 6 ++++++ c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c | 13 ++++++++----- c/src/lib/libbsp/h8300/h8sim/startup/linkcmds | 8 +++----- 3 files changed, 17 insertions(+), 10 deletions(-) (limited to 'c/src/lib/libbsp/h8300') diff --git a/c/src/lib/libbsp/h8300/h8sim/ChangeLog b/c/src/lib/libbsp/h8300/h8sim/ChangeLog index 478d370cb4..d33b3a2c88 100644 --- a/c/src/lib/libbsp/h8300/h8sim/ChangeLog +++ b/c/src/lib/libbsp/h8300/h8sim/ChangeLog @@ -1,3 +1,9 @@ +2002-08-05 Joel Sherrill + + * startup/bspstart.c, startup/linkcmds: Per PR247 , fix the linkcmds + to avoid overlapping sections and reworked the way the heap and + workspace are calculated. + 2002-07-21 Ralf Corsepius * start/Makefile.am: Eliminate PGM. diff --git a/c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c b/c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c index 29bee0077c..1543c81c3b 100644 --- a/c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c +++ b/c/src/lib/libbsp/h8300/h8sim/startup/bspstart.c @@ -56,12 +56,16 @@ void bsp_libc_init( void *, unsigned32, int ); void bsp_pretasking_hook(void) { - extern int HeapBase; - extern int HeapSize; - void *heapStart = &HeapBase; - unsigned long heapSize = (unsigned long)&HeapSize; + void *heapStart; + unsigned long heapSize; unsigned long ramSpace; + extern int WorkspaceBase; + heapStart = (void *) + ((unsigned long)&WorkspaceBase + BSP_Configuration.work_space_size); + if ( (unsigned long) heapStart > (256 * 1024) ) + rtems_fatal_error_occurred (('H'<<24) | ('E'<<16) | ('A'<<8) | 'P'); + heapSize = (256 * 1024) - (unsigned long)(heapStart); bsp_libc_init(heapStart, heapSize, 0); #ifdef RTEMS_DEBUG @@ -78,7 +82,6 @@ void bsp_pretasking_hook(void) void bsp_start( void ) { - extern int _end; extern int WorkspaceBase; /* Configure Number of Register Caches */ diff --git a/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds b/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds index b04a9728a1..739a7730c5 100644 --- a/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds +++ b/c/src/lib/libbsp/h8300/h8sim/startup/linkcmds @@ -53,7 +53,7 @@ SECTIONS _etext = .; } >ram - .tors : { + .tors SIZEOF(.text) + ADDR(.text): { ___ctors = . ; *(.ctors) ___ctors_end = . ; @@ -61,9 +61,10 @@ SECTIONS *(.dtors) ___dtors_end = . ; } >ram - .data SIZEOF(.text) + ADDR(.text): + .data SIZEOF(.tors) + ADDR(.tors): { *(.data) + *(.gcc_exc*) CONSTRUCTORS _edata = .; } >ram @@ -77,9 +78,6 @@ SECTIONS _stack_init = .; _clear_end = .; _WorkspaceBase = .; - . += 64K; /* reserve some memory for workspace */ - _HeapBase = .; - . += _HeapSize; /* reserve some memory for heap */ _end = .; __end = .; } >ram -- cgit v1.2.3