Deadstripping. NXP CodeWarrior Development Studio
Advertentie
Advertentie
Deadstripping
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:
•
__ctors
- an array of static constructors
•
__dtors
- an array of destructors
•
__rom_copy_info
- an array of a structure that contains all of the necessary information about all initialized sections to copy them from ROM to RAM
•
__bss_init_info
- a similar array that contains all of the information necessary to initialize all of the bss-type sections. Please see
__init_data
in
__start.c
.
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.
14.4 Deadstripping
If the Pool Data checkbox is checked in the CodeWarrior IDE's Properties > C/C++
Build > Settings > Tool Settings > PowerPC Compiler > Processor panel, the pooled data is not stripped. However, all small data and code is still subject to deadstripping.
14.5 CodeWarrior Linker Command File (LCF)
Linker command files are an alternative way of specifying segment addresses.
Only one linker command file is supported per target in a project. The linker command filename must end in the
.lcf
extension.
The LCF along with other compiler directives, places pieces of code and data into ROM and RAM. You can do this by creating specific sections in the LCF and then matching them to the source code using pragma directives.
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
266 Freescale Semiconductor, Inc.
Downloaden
Advertentie