]> git.ipfire.org Git - people/ms/u-boot.git/blame - include/asm-generic/sections.h
Add GPL-2.0+ SPDX-License-Identifier to source files
[people/ms/u-boot.git] / include / asm-generic / sections.h
CommitLineData
18652864
SG
1/*
2 * Copyright (c) 2011 The Chromium OS Authors.
3 *
1a459660 4 * SPDX-License-Identifier: GPL-2.0+
18652864
SG
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
14extern char _text[], _stext[], _etext[];
15extern char _data[], _sdata[], _edata[];
16extern char __bss_start[], __bss_stop[];
17extern char __init_begin[], __init_end[];
18extern char _sinittext[], _einittext[];
a733b06b 19extern char _end[], _init[];
18652864
SG
20extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
21extern char __kprobes_text_start[], __kprobes_text_end[];
22extern char __entry_text_start[], __entry_text_end[];
23extern char __initdata_begin[], __initdata_end[];
24extern char __start_rodata[], __end_rodata[];
25
26/* Start and end of .ctors section - used for constructor calls. */
27extern char __ctors_start[], __ctors_end[];
28
29/* function descriptor handling (if any). Override
30 * in asm/sections.h */
31#ifndef dereference_function_descriptor
32#define dereference_function_descriptor(p) (p)
33#endif
34
35/* random extra sections (if any). Override
36 * in asm/sections.h */
37#ifndef arch_is_kernel_text
38static inline int arch_is_kernel_text(unsigned long addr)
39{
40 return 0;
41}
42#endif
43
44#ifndef arch_is_kernel_data
45static inline int arch_is_kernel_data(unsigned long addr)
46{
47 return 0;
48}
49#endif
50
51/* U-Boot-specific things begin here */
52
53/* Start of U-Boot text region */
54extern char __text_start[];
55
56/* This marks the end of the text region which must be relocated */
57extern char __image_copy_end[];
58
59/*
60 * This is the U-Boot entry point - prior to relocation it should be same
61 * as __text_start
62 */
63extern void _start(void);
64
65/*
66 * ARM needs to use offsets for symbols, since the values of some symbols
67 * are not resolved prior to relocation (and are just 0). Maybe this can be
68 * resolved, or maybe other architectures are similar, iwc this should be
69 * promoted to an architecture option.
70 */
71#ifdef CONFIG_ARM
72#define CONFIG_SYS_SYM_OFFSETS
73#endif
74
75#ifdef CONFIG_SYS_SYM_OFFSETS
76/* Start/end of the relocation entries, as an offset from _start */
77extern ulong _rel_dyn_start_ofs;
78extern ulong _rel_dyn_end_ofs;
79
18652864
SG
80/* End of the region to be relocated, as an offset form _start */
81extern ulong _image_copy_end_ofs;
82
83extern ulong _bss_start_ofs; /* BSS start relative to _start */
84extern ulong _bss_end_ofs; /* BSS end relative to _start */
85extern ulong _end_ofs; /* end of image relative to _start */
86
87extern ulong _TEXT_BASE; /* code start */
88
89#else /* don't use offsets: */
90
91/* Exports from the Linker Script */
92extern ulong __data_end;
93extern ulong __rel_dyn_start;
94extern ulong __rel_dyn_end;
95extern ulong __bss_end;
96
97extern ulong _TEXT_BASE; /* code start */
98
99#endif
100
101#endif /* _ASM_GENERIC_SECTIONS_H_ */