blob: 17a31ec78805e5858373b4a2004ccdf20f79b168 [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[];
Heinrich Schuchardt7804ae92017-09-05 03:19:37 +020026extern char __efi_helloworld_begin[];
27extern char __efi_helloworld_end[];
Simon Glass9bce37c2013-03-05 14:39:37 +000028
29/* Start and end of .ctors section - used for constructor calls. */
30extern char __ctors_start[], __ctors_end[];
31
32/* function descriptor handling (if any). Override
33 * in asm/sections.h */
34#ifndef dereference_function_descriptor
35#define dereference_function_descriptor(p) (p)
36#endif
37
38/* random extra sections (if any). Override
39 * in asm/sections.h */
40#ifndef arch_is_kernel_text
41static inline int arch_is_kernel_text(unsigned long addr)
42{
43 return 0;
44}
45#endif
46
47#ifndef arch_is_kernel_data
48static inline int arch_is_kernel_data(unsigned long addr)
49{
50 return 0;
51}
52#endif
53
54/* U-Boot-specific things begin here */
55
56/* Start of U-Boot text region */
57extern char __text_start[];
58
59/* This marks the end of the text region which must be relocated */
60extern char __image_copy_end[];
61
62/*
63 * This is the U-Boot entry point - prior to relocation it should be same
64 * as __text_start
65 */
66extern void _start(void);
67
68/*
Albert ARIBAUD6e294722014-02-22 17:53:43 +010069 * ARM defines its symbols as char[]. Other arches define them as ulongs.
Simon Glass9bce37c2013-03-05 14:39:37 +000070 */
71#ifdef CONFIG_ARM
Simon Glass9bce37c2013-03-05 14:39:37 +000072
Albert ARIBAUD6e294722014-02-22 17:53:43 +010073extern char __bss_start[];
74extern char __bss_end[];
75extern char __image_copy_start[];
76extern char __image_copy_end[];
Simon Glass77ec34e2015-10-17 19:41:19 -060077extern char _image_binary_end[];
Albert ARIBAUD6e294722014-02-22 17:53:43 +010078extern char __rel_dyn_start[];
79extern char __rel_dyn_end[];
Simon Glass9bce37c2013-03-05 14:39:37 +000080
81#else /* don't use offsets: */
82
83/* Exports from the Linker Script */
84extern ulong __data_end;
85extern ulong __rel_dyn_start;
86extern ulong __rel_dyn_end;
87extern ulong __bss_end;
Simon Glassb30c97f2016-09-25 21:33:05 -060088extern ulong _image_binary_end;
Simon Glass9bce37c2013-03-05 14:39:37 +000089
90extern ulong _TEXT_BASE; /* code start */
91
92#endif
93
94#endif /* _ASM_GENERIC_SECTIONS_H_ */