118652864SSimon Glass /*
218652864SSimon Glass * Copyright (c) 2011 The Chromium OS Authors.
318652864SSimon Glass *
41a459660SWolfgang Denk * SPDX-License-Identifier: GPL-2.0+
518652864SSimon Glass */
618652864SSimon Glass
718652864SSimon Glass /* Taken from Linux kernel, commit f56c3196 */
818652864SSimon Glass
918652864SSimon Glass #ifndef _ASM_GENERIC_SECTIONS_H_
1018652864SSimon Glass #define _ASM_GENERIC_SECTIONS_H_
1118652864SSimon Glass
1218652864SSimon Glass /* References to section boundaries */
1318652864SSimon Glass
1418652864SSimon Glass extern char _text[], _stext[], _etext[];
1518652864SSimon Glass extern char _data[], _sdata[], _edata[];
1618652864SSimon Glass extern char __bss_start[], __bss_stop[];
1718652864SSimon Glass extern char __init_begin[], __init_end[];
1818652864SSimon Glass extern char _sinittext[], _einittext[];
19a733b06bSSimon Glass extern char _end[], _init[];
2018652864SSimon Glass extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
2118652864SSimon Glass extern char __kprobes_text_start[], __kprobes_text_end[];
2218652864SSimon Glass extern char __entry_text_start[], __entry_text_end[];
2318652864SSimon Glass extern char __initdata_begin[], __initdata_end[];
2418652864SSimon Glass extern char __start_rodata[], __end_rodata[];
25c7ae3dfdSSimon Glass extern char __efi_hello_world_begin[];
26c7ae3dfdSSimon Glass extern char __efi_hello_world_end[];
2718652864SSimon Glass
2818652864SSimon Glass /* Start and end of .ctors section - used for constructor calls. */
2918652864SSimon Glass extern char __ctors_start[], __ctors_end[];
3018652864SSimon Glass
31*d0df954bSJoseph Chen /* .ARM.exidx is sorted, so has to go in its own output section. */
32*d0df954bSJoseph Chen extern char __exidx_start[], __exidx_end[];
33*d0df954bSJoseph Chen extern char __extab_start[], __extab_end[];
34*d0df954bSJoseph Chen
3518652864SSimon Glass /* function descriptor handling (if any). Override
3618652864SSimon Glass * in asm/sections.h */
3718652864SSimon Glass #ifndef dereference_function_descriptor
3818652864SSimon Glass #define dereference_function_descriptor(p) (p)
3918652864SSimon Glass #endif
4018652864SSimon Glass
4118652864SSimon Glass /* random extra sections (if any). Override
4218652864SSimon Glass * in asm/sections.h */
4318652864SSimon Glass #ifndef arch_is_kernel_text
arch_is_kernel_text(unsigned long addr)4418652864SSimon Glass static inline int arch_is_kernel_text(unsigned long addr)
4518652864SSimon Glass {
4618652864SSimon Glass return 0;
4718652864SSimon Glass }
4818652864SSimon Glass #endif
4918652864SSimon Glass
5018652864SSimon Glass #ifndef arch_is_kernel_data
arch_is_kernel_data(unsigned long addr)5118652864SSimon Glass static inline int arch_is_kernel_data(unsigned long addr)
5218652864SSimon Glass {
5318652864SSimon Glass return 0;
5418652864SSimon Glass }
5518652864SSimon Glass #endif
5618652864SSimon Glass
5718652864SSimon Glass /* U-Boot-specific things begin here */
5818652864SSimon Glass
5918652864SSimon Glass /* Start of U-Boot text region */
6018652864SSimon Glass extern char __text_start[];
6118652864SSimon Glass
6218652864SSimon Glass /* This marks the end of the text region which must be relocated */
6318652864SSimon Glass extern char __image_copy_end[];
6418652864SSimon Glass
6518652864SSimon Glass /*
6618652864SSimon Glass * This is the U-Boot entry point - prior to relocation it should be same
6718652864SSimon Glass * as __text_start
6818652864SSimon Glass */
6918652864SSimon Glass extern void _start(void);
7018652864SSimon Glass
7118652864SSimon Glass /*
72b60eff31SAlbert ARIBAUD * ARM defines its symbols as char[]. Other arches define them as ulongs.
7318652864SSimon Glass */
7418652864SSimon Glass #ifdef CONFIG_ARM
7518652864SSimon Glass
76b60eff31SAlbert ARIBAUD extern char __bss_start[];
77b60eff31SAlbert ARIBAUD extern char __bss_end[];
78b60eff31SAlbert ARIBAUD extern char __image_copy_start[];
79b60eff31SAlbert ARIBAUD extern char __image_copy_end[];
8010172962SSimon Glass extern char _image_binary_end[];
81b60eff31SAlbert ARIBAUD extern char __rel_dyn_start[];
82b60eff31SAlbert ARIBAUD extern char __rel_dyn_end[];
8318652864SSimon Glass
8418652864SSimon Glass #else /* don't use offsets: */
8518652864SSimon Glass
8618652864SSimon Glass /* Exports from the Linker Script */
8718652864SSimon Glass extern ulong __data_end;
8818652864SSimon Glass extern ulong __rel_dyn_start;
8918652864SSimon Glass extern ulong __rel_dyn_end;
9018652864SSimon Glass extern ulong __bss_end;
9122d95743SSimon Glass extern ulong _image_binary_end;
9218652864SSimon Glass
9318652864SSimon Glass extern ulong _TEXT_BASE; /* code start */
9418652864SSimon Glass
9518652864SSimon Glass #endif
9618652864SSimon Glass
9718652864SSimon Glass #endif /* _ASM_GENERIC_SECTIONS_H_ */
98