2.5. Using a Custom Start-file

The start-file art0.S contains instructions to initialize the arithmetic unit, floating point unit and system registers. The default start-file may be suitable for your requirements. You can see the source code in file /opt/gcc-erc32-1.7/erc-coff/src/libc/art0.S. If this is not suitable, make a copy of /opt/gcc-erc32-1.7/erc-coff/src/libc/art0.S in your working directory, then edit it as necessary.

The default linker script file is /opt/gcc-erc32-1.7/erc-coff/lib/ldscripts/coff_erc.x. You should copy this file to your local directory, and edit it as necessary. To use the local copy of art0.S, you should remove the STARTUP line from the linker script file.

Example 2-4. Creating a Start File

$ cp /opt/gcc-erc32-1.7/erc-coff/src/libc/art0.S .
$ cp /opt/gcc-erc32-1.7/erc-coff/lib/ldscripts/erc_ram.x myboard.ld
$ vi art0.S
$ vi myboard.ld

You can then build a program using your custom start-file rather than the default start-file as follows:

Example 2-5. Compiling with Custom Files


$ erc-coff-gcc -g art0.S hello.c -T myboard.ld