-Cc: Allocate Const Objects into ROM

Group

OUTPUT

Scope

Compilation Unit

Syntax
  -Cc 
  
Arguments

None

Default

None

Defines

None

Pragmas

#pragma INTO_ROM: Put Next Variable Definition into ROM

Description

The Linker prepares no initialization for objects allocated into a read-only section. The startup code does not have to copy the constant data.

You may also put variables into the ROM_VAR segment by using the segment pragma (see the Linker manual).

With #pragma CONST_SECTION for constant segment allocation, variables declared as const are allocated in this segment.

If the current data segment is not the default segment, const objects in that user-defined segment are not allocated in the ROM_VAR segment but remain in the segment defined by the user. If that data segment happens to contain onlyconst objects, it may be allocated in a ROM memory section (for more information, refer to the Linker section of the Build Tools manual).

Note: In the ELF/DWARF object-file format, constants are allocated into the .rodata section.
Note: The Compiler uses the default addressing mode for the constants specified by the memory model.
Example
See also

Segmentation

Linker section in the Build Tools manual

-F (-F2, -F2o): Object File Format option

#pragma INTO_ROM: Put Next Variable Definition into ROM