|
|
 | | From: | Not Really Me | | Subject: | CW for ARM1.2 link or load problem? | | Date: | Tue, 4 Jan 2005 09:04:22 -0700 |
|
|
 | Using CW for ARMDS v1.2 I am building an embedded app, linked at 0. If I build a small test app it loads fine. If I exceed a certain size, it either doesn't link or doesn't load properly. In the code sample before, if I make the const char array smaller than 898 bytes, the code loads fine. If 898 or larger, it overwrites the 32-bit word at 0x0 with 0. Add more bytes and the word at 0x4 gets overwritten with zero also, etc.
Location zero has the "bl InitReset" from the exception vectors. The build includes Cstartup.s, Usart.c, retarget.c, startup.c and the code below. Compiler command line equivalent shows as: -O0 -W -DUSE_SERIAL_PORT Linker CL equivalent shows as: -remove (dbg) -entry scott -ro-base 0x00000000 -nolocals -list C:\Test\Source\scotty.lst -first cstartup.o(reset)
Any suggestions?
#include "stdio.h"
int main(void); void argh(void);
int main(void) { printf("Hello?"); argh(); }
//const char big[898] = { 'a', 'b', 'c', 'd', '\0' }; // fails const char big[897] = { 'a', 'b', 'c', 'd', '\0' }; // works
void argh( void ) { printf(" %s", &big); }
Scott
|
|
|