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:
#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)
{
}
{
}
#pragma ghs section text=".mytext"
/* wrong: must use pragma before the first function */
void bar(void)
{
}