Specifies a predefined section or defines a new section for compiled object code.
#pragma define_section sname ".istr" [.ustr] [.rostr][addrmode] [accmode]
sname
Identifier for source references to this user-defined section. Make sure this name does not conflict with names recognized by the __declspec directive.
istr
Section-name string for initialized data assigned to this section. Double quotes must surround this parameter value, which must begin with a period. (Also applies to uninitialized data if there is no ustr value.)
ustr
Optional, if there is no initialized data: ELF section name for uninitialized data assigned to this section. Must begin with a period. Default value is the istr value.
rostr
Optional, if there is no initialized data: ELF section name for read only data assigned to this section. Must begin with a period. Default value is the istr value.
addrmode
Optional: optional parameter indicates how the linker addresses the section. You set this parameter to one of the following values:
For more information, refer the far_call for ARM chapter in this manual.
acc
Optional: any of these letter combinations:
(No other letter orders are valid: WR, XR, or XRW would be an error.)
The compiler predefines the common Kinetis sections that The following table lists.
| Applicability | Definition Pragmas |
|---|---|
| ARM Predefined Sections | #pragma define_section text,".text",abs32,RX |
| #pragma define_section data,".data",".bss",abs32,RW | |
| #pragma define_section strdata,".data",".bss",abs32,RW | |
| #pragma define_section npdata,".data",".bss",abs32,RW | |
| #pragma define_section sdata,".sdata",abs32,RW | |
| #pragma define_section rodata,".rodata",abs32,R | |
| #pragma define_section strrodata,".rodata",abs32,R | |
| #pragma define_section nprodata,".rodata",abs32,R | |
| #pragma define_section pinit,".init_table",abs32,RW | |
| #pragma define_section init,".init",abs32,RX | |
| #pragma define_section picdynrel,".picdynrel",pcrel32,R | |
| #pragma define_section piddynrel,".piddynrel",sbrel32,R |