A processor capable of executing VLE (Variable Length Encoding) instructions must use separate memory pages for VLE and regular instructions. The compiler and linker ensure this separation by placing executable code that uses VLE instructions and regular instructions in separate object code sections.
To maintain this separation in your own linker command file, specify output sections for VLE and regular instructions. Separating VLE and regular object code in the linker's output file shows an example. This linker control file specifies that output sections named .init_vle and .text_vle should only contain object code that the compiler has tagged with VLECODE .
.init : { } > code
.init_vle (VLECODE) : {
*(.init)
*(.init_vle)
} > code
.text : { } > code
.text_vle (VLECODE) : {
*(.text)
*(.text_vle)
} > code
To save memory space, the linker compresses VLE object code by shortening the gaps between functions. A VLE function must meet these criteria to be re-aligned:
The linker will not re-align a function if it is referred to by a non-VLE function.
The linker will not re-align a function if the compiler's function alignment settings specify an explicit alignment value.