1/* 2 * Copyright (c) 2016 Intel Corporation 3 * Copyright (c) 2017 Oticon A/S 4 * 5 * SPDX-License-Identifier: Apache-2.0 6 */ 7 8/** 9 * @file 10 * @brief Linker command/script file 11 * 12 * Linker script for the POSIX (native) platform 13 */ 14 15#include <zephyr/linker/sections.h> 16 17#include <zephyr/linker/linker-defs.h> 18#include <zephyr/linker/linker-tool.h> 19 20 21SECTIONS 22{ 23 24#ifdef CONFIG_LLEXT 25#include <zephyr/linker/llext-sections.ld> 26#endif 27 28SECTION_PROLOGUE(rom_start,,) 29{ 30 /* Located in generated directory. This file is populated by the 31 * zephyr_linker_sources() Cmake function. 32 */ 33 #include <snippets-rom-start.ld> 34} GROUP_LINK_IN(ROMABLE_REGION) 35 36#include <zephyr/linker/common-rom.ld> 37/* Located in generated directory. This file is populated by calling 38 * zephyr_linker_sources(ROM_SECTIONS ...). Useful for grouping iterable RO structs. 39 */ 40#include <snippets-rom-sections.ld> 41 42SECTION_PROLOGUE(_RODATA_SECTION_NAME,,) 43{ 44 /* Located in generated directory. This file is populated by the 45 * zephyr_linker_sources() Cmake function. 46 */ 47 #include <snippets-rodata.ld> 48} GROUP_LINK_IN(ROMABLE_REGION) 49 50SECTION_DATA_PROLOGUE(_DATA_SECTION_NAME,,) 51{ 52 /* Located in generated directory. This file is populated by the 53 * zephyr_linker_sources() Cmake function. 54 */ 55 #include <snippets-rwdata.ld> 56} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION) 57 58#include <zephyr/linker/common-ram.ld> 59 60/* Located in generated directory. This file is populated by the 61 * zephyr_linker_sources() Cmake function. 62 */ 63#include <snippets-ram-sections.ld> 64 65#include <zephyr/arch/posix/native_tasks.ld> 66 67/* Located in generated directory. This file is populated by the 68 * zephyr_linker_sources() Cmake function. 69 */ 70#include <snippets-data-sections.ld> 71 72__data_region_end = .; 73 74SECTION_DATA_PROLOGUE(_NOINIT_SECTION_NAME,,) 75{ 76 /* Located in generated directory. This file is populated by the 77 * zephyr_linker_sources() Cmake function. 78 */ 79 #include <snippets-noinit.ld> 80} GROUP_LINK_IN(RAMABLE_REGION) 81 82/* Located in generated directory. This file is populated by the 83 * zephyr_linker_sources() Cmake function. 84 */ 85#include <snippets-sections.ld> 86 87} INSERT AFTER .data; 88 89#include <zephyr/arch/posix/native_sim_interface.ld> 90 91/* 92 * Note that the INSERT command actually changes the meaning of the -T command 93 * line switch: The script will now augment the default SECTIONS instead of 94 * replacing it. 95 */ 96