
Building das Blinkenlights 27
text rom : /* The actual instructions. */
{
*(.text)
}
}
This script informs the GNU linker’s built-in locator about the memory on the tar-
get board and instructs it to locate the data and bss sections in RAM (starting at
address 0x00000) and the text section in ROM (starting at 0x80000). However,
the initial values of the variables in the data segment will be made a part of the
ROM image by the addition of >rom at the end of that section’s definition.
All of the names that begin with underscores (_TopOfStack, for example) are
variables that can be referenced from within your source code. The linker will use
these symbols to resolve references in the input object files. So, for example, there
might be a part of the embedded software (usually within the startup code) that
copies the initial values of the initialized variables from ROM to the data section
in RAM. The start and stop addresses for this operation can be established symbol-
ically, by referring to the integer variables _DataStart and _DataEnd.
The result of this final step of the build process is an absolutely located binary
image that can be downloaded to the embedded system or programmed into a
read-only memory device. In the previous example, this memory image would be
exactly 1 MB in size. However, because the initial values for the initialized data
section are stored in ROM, the lower 512 kilobytes ...