Linker Generated Symbols

You can find a complete list of the linker generated symbols and user-defined symbols in either the C include file __ppc_eabi_linker.h or the assembly include file __ppc_eabi_linker.i . The CodeWarrior linker automatically generates symbols for the start address, the end address (the first byte after the last byte of the section), and the start address for the section if it will be burned into ROM. With a few exceptions, all CodeWarrior linker-generated symbols are immediate 32 bit values. Sample list of linker-generated symbols shows a sample list of linker-generated symbols.

Listing 1. Sample list of linker-generated symbols
        _f_init                 000034d8
    _f_init_rom                 000034d8

        _e_init                 000035b0

    _f_init_vle                 000035b0

_f_init_vle_rom                 000035b0

    _e_init_vle                 00003864

        _f_text                 00003864

    _f_text_rom                 00003864

        _e_text                 00003864

    _f_text_vle                 00003870

_f_text_vle_rom                 00003870

    _e_text_vle                 00003ad4

If addresses are declared in your source file as unsigned char _f_text[]; you can treat _f_text just as a C variable even though it is a 32-bit immediate value.

unsigned int textsize = _e_text - _f_text;
  

If you do need linker symbols that are not addresses, you can access them from C.

unsigned int size = (unsigned int)&_text_size;
  

The linker generates four symbols:

These four symbols are actually not 32-bit immediate values but are variables with storage. You access them just as C variables. The startup code now automatically handles initializing all bss type sections and moves all necessary sections from ROM to RAM, even for user defined sections.