IT lexicon › Programming › Scatter file

Scatter file

Programming På svenska → Updated: 2026-11-04

Arm's answer to the linker script: a .sct file telling armlink where each part of the program is stored and where it runs.

The GNU world has .ld files; build with Arm Compiler in Keil MDK and you get scatter files instead. The syntax distinguishes load regions, where the bytes sit in flash at power-up, from execution regions, where they live while the program runs. A typical file pins the vector table first with *.o (RESET, +First), lets the rest of the code land anywhere in flash with .ANY (+RO), and puts initialised and zeroed variables (+RW +ZI) in RAM.

The name comes from the program being scattered at startup: the library routine __scatterload copies RW data from flash to RAM and clears the ZI region before main() runs. It is the same job startup code does in a GCC project, just tucked away in the library. Most of the pain arrives when a project moves between toolchains and two files with the same purpose and entirely different grammars have to be kept in sync.

← Back to the lexicon