Predefined Sections. NXP CodeWarrior Development Studio
Реклама
Реклама
Chapter 14
Linker for Power Architecture Processors
This chapter describes how to use the features in the CodeWarrior linker that are specific to Power Architecture software development.
•
•
Additional Small Data Sections
•
•
•
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
Name
Table 14-1. Compiler-defined sections
Description
uninitialized global data
Binary files.
Table continues on the next page...
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
Freescale Semiconductor, Inc.
255
.ctors
.dtors
.data
extab extabindex
.init
.init_vle
.PPC.EMB.sdata0
.PPC.EMB.sbss0
.rodata
.sdata
.sdata2
.sbss
.sbss2
.text
.text_vle
Predefined Sections
Table 14-1. Compiler-defined sections (continued)
Name Description
C++ constructors and Altivec vector constructors
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
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.
3. Select Properties > C/C++ Build > Settings > Tool Settings > PowerPC Linker >
General and add the binary file to the Other Flags text box.
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
256 Freescale Semiconductor, Inc.
Chapter 14 Linker for Power Architecture Processors
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 Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
Freescale Semiconductor, Inc.
257
Скачать
Реклама