liveBook · Manning

Output section

As explained in Embedded Software with Rust

An output section is a linker-generated memory-image section formed by collecting selected input sections and assigning them an address and region.

A linker-generated output section collects selected input sections and assigns them an address and memory region. In bare-metal Cortex-M layouts, output sections place the vector table, code, and static data in FLASH or RAM. section 4.1.3

Common output-section mappings include:

  • .vector_table, .text, and .rodata are placed in FLASH. section 4.1.3
  • .data is placed in RAM with its load address in FLASH; .bss is placed in RAM as NOLOAD. section 4.1.3
SECTIONS
{
  .vector_table :
  {
    LONG(ORIGIN(RAM) + LENGTH(RAM));     /* Initial stack pointer (
        top of RAM) */
    KEEP(*(.vector_table.reset_vector))   /* Reset vector (
        entry point) */
    KEEP(*(.vector_table.exceptions))     /* Other exceptions and
    interrupts */
  } > FLASH

See linker-script syntax for collecting vector-table entries and placing the output section in FLASH. section 4.1.3

How Embedded Software with Rust covers it

How deep it goes
Shows linker-script mappings for vector, code, read-only, initialized, and zero-initialized sections.
Examples
Uses .vector_table, .text, .rodata, .data, and .bss as mapped output-section examples.
What you can do after
Configure linker-script placement for vector data, code, and static data.
How it connects
Connects linker scripts and input sections to vector tables, FLASH, RAM, and stack placement.

This explainer was generated by Manning's knowledge graph from the text of Embedded Software with Rust. The section links point to the parts of the book it draws on.