User`s guide

Pragmas for the DSP56800 and DSP56800E
Pragma Reference
416
Targeting MC56F83xx/DSP5685x Controllers
#pragma use_rodata on
const Int16 d[]={0xdddd};
const Int16 e[]={0xeeee};
const Int16 f[]={0xffff};
#pragma use_rodata off
main()
{
// ... code
}
You must then appropriately locate the .rodata section created by the compiler using
the linker command file. For example, see Listing C.19
.
Listing C.19 Sample Linker Command FIle - Pragma use_rodata
MEMORY {
.text_segment (RWX) : ORIGIN = 0x2000, LENGTH = 0x00000000
.data_segment (RW) : ORIGIN = 0x3000, LENGTH = 0x00000000
.rodata_segment (R) : ORIGIN = 0x5000, LENGTH = 0x00000000
}
SECTIONS {
.main_application :
{
# .text sections
} > .text_segment
.main_application_data :
{
# .data sections
# .bss sections
} > .data_segment
.main_application_constant_data:
{
# constant data sections
* (.rodata)
} > .rodata_segment
}