SPRU513Z August 2001 – October 2023 SM320F28335-EP
When a hole exists in an initialized output section, the linker must supply raw data to fill it. The linker fills holes with a 32-bit fill value that is replicated through memory until it fills the hole. The linker determines the fill value as follows:
SECTIONS
{ outsect:
{
file1.c.obj(.text)
file2.c.obj(.ebss)= 0xFF00 /* Fill this hole with 0xFF00 */
}
}
SECTIONS
{ outsect:fill = 0xFF00 /* Fills holes with 0xFF00 */
{
. += 0x0010; /* This creates a hole */
file1.c.obj(.text)
file1.c.obj(.ebss) /* This creates another hole */
}
}
SECTIONS { .text: { .= 0x0100; } /* Create a 100 word hole */ }
Now invoke the linker with the --fill_value option:
cl2000 --run_linker --fill_value=0xFFFF link.cmd
This fills the hole with 0xFFFF.
Whenever a hole is created and filled in an initialized output section, the hole is identified in the link map along with the value the linker uses to fill it.