Predefined Sections. NXP CodeWarrior Development Studio
विज्ञापन
विज्ञापन
Chapter 14
Linker
This chapter describes how to use the features in the CodeWarrior linker that are specific to AIOP software development.
•
•
•
•
CodeWarrior Linker Command File (LCF)
•
•
•
Relocating Code and Data in Internal RAM
•
Relocating Code and Data in External MRAM
•
•
14.1 Predefined Sections
Table 14-1 describes the sections that the compiler creates.
NOTE
The Compiler-defined section names are case sensitive. For example, using .binary instead of .BINARY will not give expected results.
.bss
.BINARY
.ctors
Name
Table 14-1. Compiler-defined sections
Description
uninitialized global data
Binary files.
C++ constructors and Altivec vector constructors
Table continues on the next page...
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
Freescale Semiconductor, Inc.
245
Predefined Sections
.dtors
.data
extab extabindex
.init
.init_vle
.PPC.EMB.sdata0
.PPC.EMB.sbss0
.rodata
.sdata
.sdata2
.sbss
.sbss2
.text
.text_vle
.tdata
.tbss
Table 14-1. Compiler-defined sections (continued)
Name Description
C++ destructors initialized global data
C++ exception tables
C++ exception tables initialization executable code from the runtime library
Initialization executable code for VLE compilers
Initialized data with addressing relative to address 0
Uninitialized data with addressing relative to address 0 literal values and initialization values in the application's source code initialized small global data initialized global small data defined with the const keyword uninitialized global small data uninitialized global constant small data defined with the const keyword application code application code for VLE compilers
AIOP task variable data section
AIOP task variable uninitialized data section
14.1.1 Linking Binary Files
You can link external binary files/data (tables, Bitmap graphics, sound records) into the project image. The following sections explain how to link binary files using CodeWarrior
IDE and Command line:
•
•
14.1.1.1 Using CodeWarrior IDE
To link a binary file using CodeWarrior IDE, perform the following steps:
1. Launch CodeWarrior and open the desired project to add the binary file.
2. Add a binary file ( bin_data.bin
) to project.
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
246 Freescale Semiconductor, Inc.
Chapter 14 Linker
3. Select Properties > C/C++ Build > Settings > Tool Settings > AIOP Linker >
General and add the binary file to the Other Flags text box.
4. Update linker command file (.lcf) and place .BINARY section into memory. Listing
shows a sample linker command file with .BINARY section.
Listing 14-1. Linker Command File with .BINARY section
MEMORY
{
resetvector: org = 0x00000000, len = 0x00000008
init: org = 0x00000020, len = 0x00000FE0
exception_handlers: org = 0x00001000, len = 0x00001000
internal_flash: org = 0x00002000, len = 0x001FD000
my_binary_data: org = 0x001FE000, len = 0x00001000
...
}
SECTIONS
{
.__bam_bootarea LOAD (0x00000000): {} > resetvector
...
.binary1_area:
{
binary1Start = .;
bin_data1.bin
binary1End = .;
} > my_binary_data
}
.binary2_area:
{
binary2Start = .;
bin_data2.bin
binary2End = .;
} > my_binary_data
}
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
Freescale Semiconductor, Inc.
247
डाउनलोड
विज्ञापन