blob: 0577238d60b7194aa988bf34e8c04874756116c4 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Simon Glass18652862013-03-05 14:39:37 +00002/*
3 * Copyright (c) 2011 The Chromium OS Authors.
Simon Glass18652862013-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 Andersonfbdbf772019-12-17 21:22:42 -050011#include <linux/types.h>
12
Simon Glass18652862013-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 Glassa733b062013-04-26 02:53:43 +000020extern char _end[], _init[];
Simon Glass18652862013-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 Schuchardt5e444892017-09-05 03:19:37 +020026extern char __efi_helloworld_begin[];
27extern char __efi_helloworld_end[];
Heinrich Schuchardt7dda1632020-07-14 21:25:28 +020028extern char __efi_var_file_begin[];
29extern char __efi_var_file_end[];
Simon Glass18652862013-03-05 14:39:37 +000030
31/* Start and end of .ctors section - used for constructor calls. */
32extern char __ctors_start[], __ctors_end[];
33
34/* function descriptor handling (if any). Override
35 * in asm/sections.h */
36#ifndef dereference_function_descriptor
37#define dereference_function_descriptor(p) (p)
38#endif
39
40/* random extra sections (if any). Override
41 * in asm/sections.h */
42#ifndef arch_is_kernel_text
43static inline int arch_is_kernel_text(unsigned long addr)
44{
45 return 0;
46}
47#endif
48
49#ifndef arch_is_kernel_data
50static inline int arch_is_kernel_data(unsigned long addr)
51{
52 return 0;
53}
54#endif
55
56/* U-Boot-specific things begin here */
57
58/* Start of U-Boot text region */
59extern char __text_start[];
60
61/* This marks the end of the text region which must be relocated */
62extern char __image_copy_end[];
63
64/*
65 * This is the U-Boot entry point - prior to relocation it should be same
66 * as __text_start
67 */
68extern void _start(void);
69
70/*
Albert ARIBAUDb60eff32014-02-22 17:53:43 +010071 * ARM defines its symbols as char[]. Other arches define them as ulongs.
Simon Glass18652862013-03-05 14:39:37 +000072 */
73#ifdef CONFIG_ARM
Simon Glass18652862013-03-05 14:39:37 +000074
Albert ARIBAUDb60eff32014-02-22 17:53:43 +010075extern char __bss_start[];
76extern char __bss_end[];
77extern char __image_copy_start[];
78extern char __image_copy_end[];
Simon Glass10172962015-10-17 19:41:19 -060079extern char _image_binary_end[];
Albert ARIBAUDb60eff32014-02-22 17:53:43 +010080extern char __rel_dyn_start[];
81extern char __rel_dyn_end[];
Simon Glass18652862013-03-05 14:39:37 +000082
83#else /* don't use offsets: */
84
85/* Exports from the Linker Script */
86extern ulong __data_end;
87extern ulong __rel_dyn_start;
88extern ulong __rel_dyn_end;
89extern ulong __bss_end;
Simon Glass22d95742016-09-25 21:33:05 -060090extern ulong _image_binary_end;
Simon Glass18652862013-03-05 14:39:37 +000091
92extern ulong _TEXT_BASE; /* code start */
93
94#endif
95
96#endif /* _ASM_GENERIC_SECTIONS_H_ */