xref: /rk3399_rockchip-uboot/include/asm-generic/sections.h (revision a733b06b69d2cb058c4363952bc0793b1f514305)
118652864SSimon Glass /*
218652864SSimon Glass  * Copyright (c) 2011 The Chromium OS Authors.
318652864SSimon Glass  *
418652864SSimon Glass  * This program is free software; you can redistribute it and/or
518652864SSimon Glass  * modify it under the terms of the GNU General Public License as
618652864SSimon Glass  * published by the Free Software Foundation; either version 2 of
718652864SSimon Glass  * the License, or (at your option) any later version.
818652864SSimon Glass  *
918652864SSimon Glass  * This program is distributed in the hope that it will be useful,
1018652864SSimon Glass  * but WITHOUT ANY WARRANTY; without even the implied warranty of
1118652864SSimon Glass  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1218652864SSimon Glass  * GNU General Public License for more details.
1318652864SSimon Glass  *
1418652864SSimon Glass  * You should have received a copy of the GNU General Public License
1518652864SSimon Glass  * along with this program; if not, write to the Free Software
1618652864SSimon Glass  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1718652864SSimon Glass  * MA 02111-1307 USA
1818652864SSimon Glass  */
1918652864SSimon Glass 
2018652864SSimon Glass /* Taken from Linux kernel, commit f56c3196 */
2118652864SSimon Glass 
2218652864SSimon Glass #ifndef _ASM_GENERIC_SECTIONS_H_
2318652864SSimon Glass #define _ASM_GENERIC_SECTIONS_H_
2418652864SSimon Glass 
2518652864SSimon Glass /* References to section boundaries */
2618652864SSimon Glass 
2718652864SSimon Glass extern char _text[], _stext[], _etext[];
2818652864SSimon Glass extern char _data[], _sdata[], _edata[];
2918652864SSimon Glass extern char __bss_start[], __bss_stop[];
3018652864SSimon Glass extern char __init_begin[], __init_end[];
3118652864SSimon Glass extern char _sinittext[], _einittext[];
32*a733b06bSSimon Glass extern char _end[], _init[];
3318652864SSimon Glass extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
3418652864SSimon Glass extern char __kprobes_text_start[], __kprobes_text_end[];
3518652864SSimon Glass extern char __entry_text_start[], __entry_text_end[];
3618652864SSimon Glass extern char __initdata_begin[], __initdata_end[];
3718652864SSimon Glass extern char __start_rodata[], __end_rodata[];
3818652864SSimon Glass 
3918652864SSimon Glass /* Start and end of .ctors section - used for constructor calls. */
4018652864SSimon Glass extern char __ctors_start[], __ctors_end[];
4118652864SSimon Glass 
4218652864SSimon Glass /* function descriptor handling (if any).  Override
4318652864SSimon Glass  * in asm/sections.h */
4418652864SSimon Glass #ifndef dereference_function_descriptor
4518652864SSimon Glass #define dereference_function_descriptor(p) (p)
4618652864SSimon Glass #endif
4718652864SSimon Glass 
4818652864SSimon Glass /* random extra sections (if any).  Override
4918652864SSimon Glass  * in asm/sections.h */
5018652864SSimon Glass #ifndef arch_is_kernel_text
5118652864SSimon Glass static inline int arch_is_kernel_text(unsigned long addr)
5218652864SSimon Glass {
5318652864SSimon Glass 	return 0;
5418652864SSimon Glass }
5518652864SSimon Glass #endif
5618652864SSimon Glass 
5718652864SSimon Glass #ifndef arch_is_kernel_data
5818652864SSimon Glass static inline int arch_is_kernel_data(unsigned long addr)
5918652864SSimon Glass {
6018652864SSimon Glass 	return 0;
6118652864SSimon Glass }
6218652864SSimon Glass #endif
6318652864SSimon Glass 
6418652864SSimon Glass /* U-Boot-specific things begin here */
6518652864SSimon Glass 
6618652864SSimon Glass /* Start of U-Boot text region */
6718652864SSimon Glass extern char __text_start[];
6818652864SSimon Glass 
6918652864SSimon Glass /* This marks the end of the text region which must be relocated */
7018652864SSimon Glass extern char __image_copy_end[];
7118652864SSimon Glass 
7218652864SSimon Glass /*
7318652864SSimon Glass  * This is the U-Boot entry point - prior to relocation it should be same
7418652864SSimon Glass  * as __text_start
7518652864SSimon Glass  */
7618652864SSimon Glass extern void _start(void);
7718652864SSimon Glass 
7818652864SSimon Glass /*
7918652864SSimon Glass  * ARM needs to use offsets for symbols, since the values of some symbols
8018652864SSimon Glass  * are not resolved prior to relocation (and are just 0). Maybe this can be
8118652864SSimon Glass  * resolved, or maybe other architectures are similar, iwc this should be
8218652864SSimon Glass  * promoted to an architecture option.
8318652864SSimon Glass  */
8418652864SSimon Glass #ifdef CONFIG_ARM
8518652864SSimon Glass #define CONFIG_SYS_SYM_OFFSETS
8618652864SSimon Glass #endif
8718652864SSimon Glass 
8818652864SSimon Glass #ifdef CONFIG_SYS_SYM_OFFSETS
8918652864SSimon Glass /* Start/end of the relocation entries, as an offset from _start */
9018652864SSimon Glass extern ulong _rel_dyn_start_ofs;
9118652864SSimon Glass extern ulong _rel_dyn_end_ofs;
9218652864SSimon Glass 
9318652864SSimon Glass /* Start/end of the relocation symbol table, as an offset from _start */
9418652864SSimon Glass extern ulong _dynsym_start_ofs;
9518652864SSimon Glass 
9618652864SSimon Glass /* End of the region to be relocated, as an offset form _start */
9718652864SSimon Glass extern ulong _image_copy_end_ofs;
9818652864SSimon Glass 
9918652864SSimon Glass extern ulong _bss_start_ofs;	/* BSS start relative to _start */
10018652864SSimon Glass extern ulong _bss_end_ofs;		/* BSS end relative to _start */
10118652864SSimon Glass extern ulong _end_ofs;		/* end of image relative to _start */
10218652864SSimon Glass 
10318652864SSimon Glass extern ulong _TEXT_BASE;	/* code start */
10418652864SSimon Glass 
10518652864SSimon Glass #else /* don't use offsets: */
10618652864SSimon Glass 
10718652864SSimon Glass /* Exports from the Linker Script */
10818652864SSimon Glass extern ulong __data_end;
10918652864SSimon Glass extern ulong __rel_dyn_start;
11018652864SSimon Glass extern ulong __rel_dyn_end;
11118652864SSimon Glass extern ulong __bss_end;
11218652864SSimon Glass 
11318652864SSimon Glass extern ulong _TEXT_BASE;	/* code start */
11418652864SSimon Glass 
11518652864SSimon Glass #endif
11618652864SSimon Glass 
11718652864SSimon Glass #endif /* _ASM_GENERIC_SECTIONS_H_ */
118