Controlling Alignment. NXP CodeWarrior Development Studio
โฆษณา
โฆษณา
Chapter 13 Linker for AIOP
}
This example defines a section in the output file named
.myText
. This section will contain the objects that are in the
.text
section in the object code taken from the input file named main.o
. The example also defines a section in the output file named
.text
. This section will contain all objects in the
.text
sections of all input files containing object code. Both these sections in the output file,
.myText
and
.text
, will be loaded in the memory area named text
on the target platform.
The
SECTIONS
and
GROUP
directives also allow you to filter what kinds of object code from
input files will be stored in a section in the output file. Table 13-1 shows the kinds of data
that may be filtered.
TEXT
CODE
DATA
BSS
CONST
MIXED
VLECODE
Table 13-1. Filter types for object code in input files
This filter allows input objects that have these permissions
readable, executable readable, executable readable, writable readable, writable readable readable, writable, executable readable, executable
and contain this kind of object code
initialized initialized initialized uninitialized initialized initialized initialized
shows an example.
Listing 13-6. Filtering objects from input files
SECTIONS
{
.text (TEXT) : { } > text
.bss (BSS) : { } > data
}
This example defines a section in the output file named
.text
. The linker will only store objects from input object code that are readable, executable, and initialized. This example also defines a section in the output file named
.bss
. This section will only contain objects from the linker's input files that are readable, writable, and uninitialized.
13.6 Controlling Alignment
CodeWarrior Development Studio for Advanced Packet Processing Build Tools Reference Manual, Rev.
10.2, 01/2016
Freescale Semiconductor, Inc.
209
ดาวน์โหลด
โฆษณา