2.2. How to Customize the Linker Script File

The linker script file describes the layout of memory on the target computer and includes instructions on how the linker is to place object code modules in that memory. The default linker script file is /opt/erc32-ada-1.7/erc-coff/lib/ldscripts/coff_erc.x. You should copy this file to your local directory, and edit as necessary.

Example 2-4. Editing the Linker Script File

$ cp /opt/erc32-ada-1.7/erc-coff/lib/ldscripts/coff_erc.x myboard.ld
$ vi myboard.ld

You can then build a program using your custom linker script rather than the default as follows:

Example 2-5. Using a Custom Linker Script File

$ erc-coff-gnatmake -f hello -largs -T myboard.ld