1 /*
2 * Copyright (c) 2011 The Chromium OS Authors.
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7 /* Taken from Linux kernel, commit f56c3196 */
8
9 #ifndef _ASM_GENERIC_SECTIONS_H_
10 #define _ASM_GENERIC_SECTIONS_H_
11
12 /* References to section boundaries */
13
14 extern char _text[], _stext[], _etext[];
15 extern char _data[], _sdata[], _edata[];
16 extern char __bss_start[], __bss_stop[];
17 extern char __init_begin[], __init_end[];
18 extern char _sinittext[], _einittext[];
19 extern char _end[], _init[];
20 extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
21 extern char __kprobes_text_start[], __kprobes_text_end[];
22 extern char __entry_text_start[], __entry_text_end[];
23 extern char __initdata_begin[], __initdata_end[];
24 extern char __start_rodata[], __end_rodata[];
25 extern char __efi_hello_world_begin[];
26 extern char __efi_hello_world_end[];
27
28 /* Start and end of .ctors section - used for constructor calls. */
29 extern char __ctors_start[], __ctors_end[];
30
31 /* .ARM.exidx is sorted, so has to go in its own output section. */
32 extern char __exidx_start[], __exidx_end[];
33 extern char __extab_start[], __extab_end[];
34
35 /* function descriptor handling (if any). Override
36 * in asm/sections.h */
37 #ifndef dereference_function_descriptor
38 #define dereference_function_descriptor(p) (p)
39 #endif
40
41 /* random extra sections (if any). Override
42 * in asm/sections.h */
43 #ifndef arch_is_kernel_text
arch_is_kernel_text(unsigned long addr)44 static inline int arch_is_kernel_text(unsigned long addr)
45 {
46 return 0;
47 }
48 #endif
49
50 #ifndef arch_is_kernel_data
arch_is_kernel_data(unsigned long addr)51 static inline int arch_is_kernel_data(unsigned long addr)
52 {
53 return 0;
54 }
55 #endif
56
57 /* U-Boot-specific things begin here */
58
59 /* Start of U-Boot text region */
60 extern char __text_start[];
61
62 /* This marks the end of the text region which must be relocated */
63 extern char __image_copy_end[];
64
65 /*
66 * This is the U-Boot entry point - prior to relocation it should be same
67 * as __text_start
68 */
69 extern void _start(void);
70
71 /*
72 * ARM defines its symbols as char[]. Other arches define them as ulongs.
73 */
74 #ifdef CONFIG_ARM
75
76 extern char __bss_start[];
77 extern char __bss_end[];
78 extern char __image_copy_start[];
79 extern char __image_copy_end[];
80 extern char _image_binary_end[];
81 extern char __rel_dyn_start[];
82 extern char __rel_dyn_end[];
83
84 #else /* don't use offsets: */
85
86 /* Exports from the Linker Script */
87 extern ulong __data_end;
88 extern ulong __rel_dyn_start;
89 extern ulong __rel_dyn_end;
90 extern ulong __bss_end;
91 extern ulong _image_binary_end;
92
93 extern ulong _TEXT_BASE; /* code start */
94
95 #endif
96
97 #endif /* _ASM_GENERIC_SECTIONS_H_ */
98