Creating Symbols

You can create symbols that you can use in your program by assigning a symbol to some value in your linker command file.

.text : { _red_start = .; *(.text) _red_end = .;} > text
  

In the example above, the linker generates the symbols _red_start and _red_end as 32 bit values that you can access in your source files. _red_start is the address of the first byte of the .text section and _red_end is the byte that follows the last byte of the .text section.

You can use any of the pseudo functions in the address_modifiers in a calculation.

The CodeWarrior linker automatically generates symbols for the start address, the end address, and the start address for the section if it is to be burned into ROM. For a section .red , we create _f_red , _e_red, and _f_red_rom . In all cases, any "." in the name is replaced with a " _ ". Addresses begin with an " _f ", addresses after the last byte in section begin with an " _e ", and ROM addresses end in a " _rom ". See the header file __ ppc_eabi_linker.h for further details.

All user defined sections follow the preceding pattern. However, you can override one or more of the symbols that the linker generates by defining the symbol in the linker command file.

Note: BSS sections do not have a ROM symbol.
Related information
Specifying Link Order in the IDE
Dead-Stripping
Defining the Target's Memory Map
Defining Sections in the Output File
Associating Input Sections With Output Sections
Controlling Alignment
Specifying Memory Area Locations and Sizes
Creating Memory Gaps
Linker Command File Syntax
Commands, Directives, and Keywords