blob: 024b1adde270e73d0b51c47b7f4034614a8fa57b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glass9bce37c2013-03-05 14:39:37 +00002/*
3 * Copyright (c) 2011 The Chromium OS Authors.
Simon Glass9bce37c2013-03-05 14:39:37 +00004 */
5
6/* Taken from Linux kernel, commit f56c3196 */
7
8#ifndef _ASM_GENERIC_SECTIONS_H_
9#define _ASM_GENERIC_SECTIONS_H_
10
Sean Anderson9efec312019-12-17 21:22:42 -050011#include <linux/types.h>
12
Simon Glass9bce37c2013-03-05 14:39:37 +000013/* References to section boundaries */
14
15extern char _text[], _stext[], _etext[];
16extern char _data[], _sdata[], _edata[];
17extern char __bss_start[], __bss_stop[];
18extern char __init_begin[], __init_end[];
19extern char _sinittext[], _einittext[];
Simon Glass62cf9122013-04-26 02:53:43 +000020extern char _end[], _init[];
Simon Glass9bce37c2013-03-05 14:39:37 +000021extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
22extern char __kprobes_text_start[], __kprobes_text_end[];
23extern char __entry_text_start[], __entry_text_end[];
24extern char __initdata_begin[], __initdata_end[];
25extern char __start_rodata[], __end_rodata[];
Ilias Apalodimas3f9a3112025-02-20 15:54:40 +020026extern char __start_data[], __end_data[];
Heinrich Schuchardt7804ae92017-09-05 03:19:37 +020027extern char __efi_helloworld_begin[];
28extern char __efi_helloworld_end[];
Heinrich Schuchardt4b7d5c12020-07-14 21:25:28 +020029extern char __efi_var_file_begin[];
30extern char __efi_var_file_end[];
Simon Glass9bce37c2013-03-05 14:39:37 +000031
Simon Glass8dee67a2021-03-15 17:25:38 +130032/* Private data used by of-platdata devices/uclasses */
33extern char __priv_data_start[], __priv_data_end[];
34
Simon Glass9bce37c2013-03-05 14:39:37 +000035/* Start and end of .ctors section - used for constructor calls. */
36extern char __ctors_start[], __ctors_end[];
37
Ilias Apalodimas9b378942024-03-15 08:43:47 +020038extern char __efi_runtime_rel_start[], __efi_runtime_rel_stop[];
Ilias Apalodimas048a9ec2024-03-15 08:43:49 +020039extern char __efi_runtime_start[], __efi_runtime_stop[];
Ilias Apalodimas9b378942024-03-15 08:43:47 +020040
Simon Glass9bce37c2013-03-05 14:39:37 +000041/* function descriptor handling (if any). Override
42 * in asm/sections.h */
43#ifndef dereference_function_descriptor
44#define dereference_function_descriptor(p) (p)
45#endif
46
47/* random extra sections (if any). Override
48 * in asm/sections.h */
49#ifndef arch_is_kernel_text
50static inline int arch_is_kernel_text(unsigned long addr)
51{
52 return 0;
53}
54#endif
55
56#ifndef arch_is_kernel_data
57static inline int arch_is_kernel_data(unsigned long addr)
58{
59 return 0;
60}
61#endif
62
63/* U-Boot-specific things begin here */
64
65/* Start of U-Boot text region */
66extern char __text_start[];
Ilias Apalodimas3f9a3112025-02-20 15:54:40 +020067extern char __text_end[];
Simon Glass9bce37c2013-03-05 14:39:37 +000068
Shiji Yangbb112342023-08-03 09:47:16 +080069/* This marks the text region which must be relocated */
70extern char __image_copy_start[], __image_copy_end[];
71
Simon Glass100e5b02025-01-26 11:43:20 -070072/* This marks the rcode region used for SPL relocation */
73extern char _rcode_start[], _rcode_end[];
74
Shiji Yangbb112342023-08-03 09:47:16 +080075extern char __bss_end[];
76extern char __rel_dyn_start[], __rel_dyn_end[];
77extern char _image_binary_end[];
Simon Glass9bce37c2013-03-05 14:39:37 +000078
79/*
80 * This is the U-Boot entry point - prior to relocation it should be same
81 * as __text_start
82 */
83extern void _start(void);
84
Simon Glass100e5b02025-01-26 11:43:20 -070085#ifndef USE_HOSTCC
86#if CONFIG_IS_ENABLED(RELOC_LOADER)
87#define __rcode __section(".text.rcode")
88#define __rdata __section(".text.rdata")
89#else
90#define __rcode
91#define __rdata
92#endif
93#else
94#define __rcode
95#define __rdata
96#endif
97
Simon Glass9bce37c2013-03-05 14:39:37 +000098#endif /* _ASM_GENERIC_SECTIONS_H_ */