[coreboot] Doubts about link scripts
jwerner at chromium.org
Wed Jul 25 08:15:54 CEST 2018
> I try to read link scripts of coreboot.
> In addition to the x86 platform, code segments and data segments are contiguous during the bootblock/romstage phase.
There is no data segment for bootblock/romstage on x86. You are not
allowed to use global (or static local) variables. The build system
will enforce this. You can see that
defines ARCH_STAGE_HAS_DATA_SECTION and ARCH_STAGE_HAS_BSS_SECTION to
0, so the .data and .bss sections in
get removed by the preprocessor.
There is the special mechanism of a CAR_GLOBAL variable which needs to
be marked as such in the code and only accessed through the
car_get_var()/car_set_var() macros (from
They are placed in a special section that gets linked to the CAR
address space by the
On other architectures (like Arm), we don't have any systems that
execute directly from flash (yet). We always load code and data into
SRAM before executing so they can be contiguous in there.
More information about the coreboot