Renaming Text Sections

You can rename a text section, but there are some restrictions. You can rename a text section only once per program source file, before the very first function in the source file.

For example, the following source file places the function foo() into the text section .mytext:

#pragma ghs section text=".mytext"
void foo(void)
{
}

The following examples show incorrect usage:

Bad Example 1

#pragma ghs section text=".mytext"
void foo(void)
{
}
#pragma ghs section text=".mytext2"
/* wrong: can only have one pragma to rename */
/* text section */
void bar(void)
{
}

Bad Example 2

void foo(void)

{
}
#pragma ghs section text=".mytext"
/* wrong: must use pragma before the first function */
void bar(void)
{
}

Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.