
Pragma Directives
5-8
5.4.2 The DATA_SECTION Pragma
The DATA_SECTION pragma allocates space for the
symbol
in a section
named
section name
. The syntax of the pragma is:
#pragma DATA_SECTION (
symbol
, “
section name
”
);
The DATA_SECTION pragma is useful if you have data objects that you want
to link into an area separate from the .bss section.
2 demonstrates the use of the DATA_SECTION pragma.
Example 5
−
2. Using the DATA_SECTION Pragma
(a) C source file
#pragma DATA_SECTION(bufferB, ”my_sect”)
char bufferA[512];
char bufferB[512];
(b) Assembly source file
.global _bufferA
.bss
_bufferA,512,4
.global _bufferB
_bufferB:
.usect
”my_sect”,512,4
5.4.3 The FUNC_EXT_CALLED Pragma
When you use the
−
pm option, the compiler uses program-level optimization.
When you use this type of optimization, the compiler removes any function
that is not called, directly or indirectly, by main. You might have C functions that
are called by hand-coded assembly instead of main.
The FUNC_EXT_CALLED pragma specifies to the optimizer to keep these C
functions or any other functions that these C functions call. These functions
act as entry points into C.
The pragma must appear before any declaration or reference to the function
that you want to keep. The syntax of the pragma is:
#pragma FUNC_EXT_CALLED
(
func
);
The argument
func
is the name of the C function that you do not want removed.
When you use program-level optimization, you may need to use the
FUNC_EXT_CALLED pragma with certain options. See section 3.3.2,
Opti-
mization Considerations When Using Mixing C and Assembly
Содержание TMS320C2x
Страница 8: ...viii...
Страница 69: ...2 47 C Compiler Description...
Страница 159: ...6 36...
Страница 226: ...8 6...
Страница 250: ...Index Index 14 Z z shell option 2 2 2 4 2 14 overriding with c option 4 5 overriding with n option 2 13...