section

This pragma controls the organization of object code.

Syntax

  #pragma section <sectname> begin

    [...data..]

    #pragma section <sectname> end

    
Remarks

Argument:

<sectname>

Identifier by which this user-defined section is referenced in the source.

Listing: Sample Code - pragma define_section and pragma section
/* 1. Define the section */

#pragma define_section mysection ".mysection.data" RW



/* 2. Specify the data to be put into the section. */



#pragma section mysection begin



int a[10] = {'0','1','2','3','4','5','6','7','8','9'};



int b[10];



#pragma section mysection end



int main(void) {



    int i;



    for (i=0;i<10;i++)



      b[i]=a[i];



}



/* 3. In the linker command file, add ".mysection.data" in the ".data" 

sections area of the linker command file by inserting the following 

line:



    * (.mysection.data)



*/
RelatedPragma

define_section