/* * Copyright (c) 2019-2020 Cobham Gaisler AB * * SPDX-License-Identifier: Apache-2.0 */ /** * @file * @brief Linker command/script file for SPARC */ #include #include #include #include ENTRY(CONFIG_KERNEL_ENTRY) SECTIONS { #include #ifdef CONFIG_LLEXT #include #endif __rom_region_start = .; SECTION_PROLOGUE(_TEXT_SECTION_NAME,,) { /* Trap table alignment required by SPARC V8 specification. */ . = ALIGN(0x1000); __text_region_start = .; *(.text.traptable) *(.text) *(.text.*) *(.stub) *(.gnu.linkonce.t.*) } GROUP_LINK_IN(REGION_TEXT) __text_region_end = .; __rodata_region_start = .; #include /* Located in generated directory. This file is populated by calling * zephyr_linker_sources(ROM_SECTIONS ...). Useful for grouping iterable RO structs. */ #include #include SECTION_PROLOGUE(_RODATA_SECTION_NAME,,) { . = ALIGN(8); *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) *(.rodata1) /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ #include } GROUP_LINK_IN(REGION_RODATA) #include __rodata_region_end = .; __rodata_region_size = __rodata_region_end - __rodata_region_start; __rom_region_end = .; __data_region_load_start = .; SECTION_PROLOGUE(.plt,,) { *(.plt) } SECTION_PROLOGUE(.iplt,,) { *(.iplt) } SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,) { . = ALIGN(8); _image_ram_start = .; __data_region_start = .; __data_start = .; *(.data) *(.data.*) *(.gnu.linkonce.d.*) SORT(CONSTRUCTORS) /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ #include __data_end = .; } GROUP_DATA_LINK_IN(REGION_DATA_VMA, REGION_DATA_LMA) __data_size = __data_end - __data_start; __data_load_start = LOADADDR(_DATA_SECTION_NAME); #include /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ #include /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ #include __data_region_end = .; SECTION_DATA_PROLOGUE(_BSS_SECTION_NAME,(NOLOAD),) { /* * For performance, BSS section is assumed to be 4 byte aligned and * a multiple of 4 bytes */ . = ALIGN(4); __bss_start = .; *(.dynbss) *(.bss) *(.bss.*) *(.gnu.linkonce.b.*) COMMON_SYMBOLS /* * As memory is cleared in words only, it is simpler to ensure the BSS * section ends on a 4 byte boundary. This wastes a maximum of 3 bytes. */ __bss_end = ALIGN(4); } GROUP_LINK_IN(REGION_BSS) SECTION_PROLOGUE(_NOINIT_SECTION_NAME,(NOLOAD),) { /* * This section is used for non-initialized objects that * will not be cleared during the boot process. */ *(.noinit) *(.noinit.*) /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ #include } GROUP_LINK_IN(REGION_BSS) #include /* Located in generated directory. This file is populated by the * zephyr_linker_sources() Cmake function. */ #include #include GROUP_END(RAMABLE_REGION) #include /DISCARD/ : { *(.note.GNU-stack) } /DISCARD/ : { *(.gnu_debuglink) } /DISCARD/ : { *(.gnu.lto_*) } SECTION_PROLOGUE(.gnu.attributes, 0,) { KEEP(*(.gnu.attributes)) } }