blob: d69bc6035be944d41228cec5d420be2f951740ed [file] [log] [blame]
Simon Glass9bce37c2013-03-05 14:39:37 +00001/*
2 * Copyright (c) 2011 The Chromium OS Authors.
3 *
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
Simon Glass9bce37c2013-03-05 14:39:37 +00005 */
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[];
Simon Glass62cf9122013-04-26 02:53:43 +000019extern char _end[], _init[];
Simon Glass9bce37c2013-03-05 14:39:37 +000020extern 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/*
Albert ARIBAUD6e294722014-02-22 17:53:43 +010066 * ARM defines its symbols as char[]. Other arches define them as ulongs.
Simon Glass9bce37c2013-03-05 14:39:37 +000067 */
68#ifdef CONFIG_ARM
Simon Glass9bce37c2013-03-05 14:39:37 +000069
Albert ARIBAUD6e294722014-02-22 17:53:43 +010070extern char __bss_start[];
71extern char __bss_end[];
72extern char __image_copy_start[];
73extern char __image_copy_end[];
Simon Glass77ec34e2015-10-17 19:41:19 -060074extern char _image_binary_end[];
Albert ARIBAUD6e294722014-02-22 17:53:43 +010075extern char __rel_dyn_start[];
76extern char __rel_dyn_end[];
Simon Glass9bce37c2013-03-05 14:39:37 +000077
78#else /* don't use offsets: */
79
80/* Exports from the Linker Script */
81extern ulong __data_end;
82extern ulong __rel_dyn_start;
83extern ulong __rel_dyn_end;
84extern ulong __bss_end;
Simon Glassb30c97f2016-09-25 21:33:05 -060085extern ulong _image_binary_end;
Simon Glass9bce37c2013-03-05 14:39:37 +000086
87extern ulong _TEXT_BASE; /* code start */
88
89#endif
90
91#endif /* _ASM_GENERIC_SECTIONS_H_ */