2 * Copyright (c) 2011 The Chromium OS Authors.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of
7 * the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 /* Taken from Linux kernel, commit f56c3196 */
22 #ifndef _ASM_GENERIC_SECTIONS_H_
23 #define _ASM_GENERIC_SECTIONS_H_
25 /* References to section boundaries */
27 extern char _text[], _stext[], _etext[];
28 extern char _data[], _sdata[], _edata[];
29 extern char __bss_start[], __bss_stop[];
30 extern char __init_begin[], __init_end[];
31 extern char _sinittext[], _einittext[];
32 extern char _end[], _init[];
33 extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
34 extern char __kprobes_text_start[], __kprobes_text_end[];
35 extern char __entry_text_start[], __entry_text_end[];
36 extern char __initdata_begin[], __initdata_end[];
37 extern char __start_rodata[], __end_rodata[];
39 /* Start and end of .ctors section - used for constructor calls. */
40 extern char __ctors_start[], __ctors_end[];
42 /* function descriptor handling (if any). Override
43 * in asm/sections.h */
44 #ifndef dereference_function_descriptor
45 #define dereference_function_descriptor(p) (p)
48 /* random extra sections (if any). Override
49 * in asm/sections.h */
50 #ifndef arch_is_kernel_text
51 static inline int arch_is_kernel_text(unsigned long addr)
57 #ifndef arch_is_kernel_data
58 static inline int arch_is_kernel_data(unsigned long addr)
64 /* U-Boot-specific things begin here */
66 /* Start of U-Boot text region */
67 extern char __text_start[];
69 /* This marks the end of the text region which must be relocated */
70 extern char __image_copy_end[];
73 * This is the U-Boot entry point - prior to relocation it should be same
76 extern void _start(void);
79 * ARM needs to use offsets for symbols, since the values of some symbols
80 * are not resolved prior to relocation (and are just 0). Maybe this can be
81 * resolved, or maybe other architectures are similar, iwc this should be
82 * promoted to an architecture option.
85 #define CONFIG_SYS_SYM_OFFSETS
88 #ifdef CONFIG_SYS_SYM_OFFSETS
89 /* Start/end of the relocation entries, as an offset from _start */
90 extern ulong _rel_dyn_start_ofs;
91 extern ulong _rel_dyn_end_ofs;
93 /* End of the region to be relocated, as an offset form _start */
94 extern ulong _image_copy_end_ofs;
96 extern ulong _bss_start_ofs; /* BSS start relative to _start */
97 extern ulong _bss_end_ofs; /* BSS end relative to _start */
98 extern ulong _end_ofs; /* end of image relative to _start */
100 extern ulong _TEXT_BASE; /* code start */
102 #else /* don't use offsets: */
104 /* Exports from the Linker Script */
105 extern ulong __data_end;
106 extern ulong __rel_dyn_start;
107 extern ulong __rel_dyn_end;
108 extern ulong __bss_end;
110 extern ulong _TEXT_BASE; /* code start */
114 #endif /* _ASM_GENERIC_SECTIONS_H_ */