Zephyr Project API
4.1.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
linker-tool-gcc.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013-2014, Wind River Systems, Inc.
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
15
#ifndef ZEPHYR_INCLUDE_LINKER_LINKER_TOOL_GCC_H_
16
#define ZEPHYR_INCLUDE_LINKER_LINKER_TOOL_GCC_H_
17
18
#include <
zephyr/kernel/mm.h
>
19
20
#if defined(CONFIG_ARM)
21
#if defined(CONFIG_BIG_ENDIAN)
22
#define OUTPUT_FORMAT_ "elf32-bigarm"
23
#else
24
#define OUTPUT_FORMAT_ "elf32-littlearm"
25
#endif
26
OUTPUT_FORMAT(OUTPUT_FORMAT_)
27
#elif defined(CONFIG_ARM64)
28
OUTPUT_FORMAT(
"elf64-littleaarch64"
)
29
#elif defined(CONFIG_ARC)
30
#if defined(CONFIG_ISA_ARCV3) && defined(CONFIG_64BIT)
31
OUTPUT_FORMAT(
"elf64-littlearc64"
)
32
#elif defined(CONFIG_ISA_ARCV3) && !defined(CONFIG_64BIT)
33
OUTPUT_FORMAT(
"elf32-littlearc64"
)
34
#else
35
OUTPUT_FORMAT(
"elf32-littlearc"
,
"elf32-bigarc"
,
"elf32-littlearc"
)
36
#endif
37
#elif defined(CONFIG_X86)
38
#if defined(CONFIG_X86_64)
39
OUTPUT_FORMAT(
"elf64-x86-64"
)
40
OUTPUT_ARCH("i386:x86-64")
41
#else
42
OUTPUT_FORMAT(
"elf32-i386"
,
"elf32-i386"
,
"elf32-i386"
)
43
OUTPUT_ARCH("i386")
44
#endif
45
#elif defined(CONFIG_NIOS2)
46
OUTPUT_FORMAT(
"elf32-littlenios2"
,
"elf32-bignios2"
,
"elf32-littlenios2"
)
47
#elif defined(CONFIG_RISCV)
48
OUTPUT_ARCH(
"riscv"
)
49
#ifdef CONFIG_64BIT
50
OUTPUT_FORMAT(
"elf64-littleriscv"
)
51
#else
52
OUTPUT_FORMAT(
"elf32-littleriscv"
)
53
#endif
54
#elif defined(CONFIG_XTENSA)
55
/* Not needed */
56
#elif defined(CONFIG_MIPS)
57
OUTPUT_ARCH(
"mips"
)
58
#elif defined(CONFIG_ARCH_POSIX)
59
/* Not needed */
60
#elif defined(CONFIG_SPARC)
61
OUTPUT_FORMAT(
"elf32-sparc"
)
62
#elif defined(CONFIG_RX)
63
OUTPUT_FORMAT(
"elf32-rx-le"
)
64
#else
65
#error Arch not supported.
66
#endif
67
68
/*
69
* The GROUP_START() and GROUP_END() macros are used to define a group
70
* of sections located in one memory area, such as RAM, ROM, etc.
71
* The <where> parameter is the name of the memory area.
72
*/
73
#define GROUP_START(where)
74
#define GROUP_END(where)
75
92
#if defined(CONFIG_ARCH_POSIX)
93
#define GROUP_LINK_IN(where)
94
#elif !defined(K_MEM_IS_VM_KERNEL)
95
#define GROUP_LINK_IN(where) > where
96
#endif
97
116
#if defined(CONFIG_ARCH_POSIX)
117
#define GROUP_ROM_LINK_IN(vregion, lregion)
118
#elif defined(K_MEM_IS_VM_KERNEL)
119
#define GROUP_ROM_LINK_IN(vregion, lregion) > vregion AT > lregion
120
#else
121
#define GROUP_ROM_LINK_IN(vregion, lregion) > lregion
122
#endif
123
136
#if defined(CONFIG_ARCH_POSIX)
137
#define GROUP_DATA_LINK_IN(vregion, lregion)
138
#elif defined(CONFIG_XIP) || defined(K_MEM_IS_VM_KERNEL)
139
#define GROUP_DATA_LINK_IN(vregion, lregion) > vregion AT > lregion
140
#else
141
#define GROUP_DATA_LINK_IN(vregion, lregion) > vregion
142
#endif
143
154
#if defined(CONFIG_ARCH_POSIX)
155
#define GROUP_NOLOAD_LINK_IN(vregion, lregion)
156
#elif defined(K_MEM_IS_VM_KERNEL)
157
#define GROUP_NOLOAD_LINK_IN(vregion, lregion) > vregion AT > lregion
158
#elif defined(CONFIG_XIP)
159
#define GROUP_NOLOAD_LINK_IN(vregion, lregion) > vregion AT > vregion
160
#else
161
#define GROUP_NOLOAD_LINK_IN(vregion, lregion) > vregion
162
#endif
163
177
#ifdef K_MEM_IS_VM_KERNEL
178
/* If we have a virtual memory map we need ALIGN_WITH_INPUT in all sections */
179
#define SECTION_PROLOGUE(name, options, align) \
180
name options : ALIGN_WITH_INPUT align
181
#else
182
#define SECTION_PROLOGUE(name, options, align) \
183
name options : align
184
#endif
185
203
#if defined(CONFIG_XIP)
204
#define SECTION_DATA_PROLOGUE(name, options, align) \
205
name options : ALIGN_WITH_INPUT
206
#else
207
#define SECTION_DATA_PROLOGUE(name, options, align) \
208
SECTION_PROLOGUE(name, options, align)
209
#endif
210
211
#define COMMON_SYMBOLS *(COMMON)
212
213
#endif
/* ZEPHYR_INCLUDE_LINKER_LINKER_TOOL_GCC_H_ */
mm.h
include
zephyr
linker
linker-tool-gcc.h
Generated on Sun May 4 2025 13:59:46 for Zephyr Project API by
1.9.8