1 /* SPDX-License-Identifier: GPL-2.0-only */
5 /* This file is included inside a SECTIONS block */
7 /* First we place the code and read only data (typically const declared).
8 * This could theoretically be placed in rom.
9 * The '.' in '.text . : {' is actually significant to prevent missing some
10 * SoC's entry points due to artificial alignment restrictions, see
11 * https://sourceware.org/binutils/docs/ld/Output-Section-Address.html
16 #if !(ENV_X86 && ENV_BOOTBLOCK)
23 KEEP(*(.metadata_hash_anchor));
28 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
29 _cbmem_init_hooks = .;
30 KEEP(*(.rodata.cbmem_init_hooks_early));
31 KEEP(*(.rodata.cbmem_init_hooks));
32 _ecbmem_init_hooks = .;
33 RECORD_SIZE(cbmem_init_hooks)
36 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
39 _ersbe_init_begin = .;
40 RECORD_SIZE(rsbe_init_begin)
43 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
45 KEEP(*(.rodata.pci_driver));
47 RECORD_SIZE(pci_drivers)
48 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
50 KEEP(*(.rodata.cpu_driver));
52 RECORD_SIZE(cpu_drivers)
55 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
58 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
63 #if ENV_RAMSTAGE && (CONFIG(COVERAGE) || CONFIG(ASAN_IN_RAMSTAGE))
74 /* Include data, bss, and heap in that order. Not defined for all stages. */
75 #if ENV_HAS_DATA_SECTION
77 . = ALIGN(ARCH_CACHELINE_ALIGN_SIZE);
81 * The postcar phase uses a stack value that is located in the relocatable
82 * module section. While the postcar stage could be linked like smm and
83 * other rmodules the postcar stage needs similar semantics of the more
84 * traditional stages in the coreboot infrastructure. Therefore it's easier
85 * to specialize this case.
87 #if ENV_RMODULE || ENV_POSTCAR
89 KEEP(*(.module_parameters));
91 RECORD_SIZE(rmodule_params)
99 #if ENV_ROMSTAGE_OR_BEFORE
100 PROVIDE(_preram_cbmem_console = .);
101 PROVIDE(_epreram_cbmem_console = _preram_cbmem_console);
102 PROVIDE(_preram_cbmem_console_size = ABSOLUTE(0));
104 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
110 RECORD_SIZE(bs_init_begin)
113 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
119 #if !ENV_SEPARATE_BSS
121 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
127 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
133 #if ENV_HAS_HEAP_SECTION
135 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
137 . += (ENV_RMODULE ? __heap_size : CONFIG_HEAP_SIZE);
138 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
144 #if ENV_RAMSTAGE && CONFIG(ASAN_IN_RAMSTAGE)
145 _shadow_size = (_eheap - _data) >> 3;
146 REGION(asan_shadow, ., _shadow_size, ARCH_POINTER_ALIGN_SIZE)
152 /* Discard the sections we don't need/want */