blob: b58fd667f87bc7c7b093c3cac1d293d78d89ec4d [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef _ASM_GENERIC_SECTIONS_H_
2#define _ASM_GENERIC_SECTIONS_H_
3
4/* References to section boundaries */
5
Geert Uytterhoeven7f8998c2014-10-09 15:30:30 -07006#include <linux/compiler.h>
7
Jiang Liu1622d1a2013-07-03 15:03:33 -07008/*
9 * Usage guidelines:
10 * _text, _data: architecture specific, don't use them in arch-independent code
11 * [_stext, _etext]: contains .text.* sections, may also contain .rodata.*
12 * and/or .init.* sections
13 * [_sdata, _edata]: contains .data.* sections, may also contain .rodata.*
14 * and/or .init.* sections.
15 * [__start_rodata, __end_rodata]: contains .rodata.* sections
16 * [__init_begin, __init_end]: contains .init.* sections, but .init.text.*
17 * may be out of this range on some architectures.
18 * [_sinittext, _einittext]: contains .init.text.* sections
19 * [__bss_start, __bss_stop]: contains BSS sections
20 *
21 * Following global variables are optional and may be unavailable on some
22 * architectures and/or kernel configurations.
23 * _text, _data
24 * __kprobes_text_start, __kprobes_text_end
25 * __entry_text_start, __entry_text_end
26 * __ctors_start, __ctors_end
27 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070028extern char _text[], _stext[], _etext[];
29extern char _data[], _sdata[], _edata[];
30extern char __bss_start[], __bss_stop[];
31extern char __init_begin[], __init_end[];
32extern char _sinittext[], _einittext[];
Linus Torvalds1da177e2005-04-16 15:20:36 -070033extern char _end[];
Tejun Heo3e5d8f92009-01-13 20:41:35 +090034extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
Prasanna S Panchamukhid0aaff92005-09-06 15:19:26 -070035extern char __kprobes_text_start[], __kprobes_text_end[];
Jiri Olsaea714542011-03-07 19:10:39 +010036extern char __entry_text_start[], __entry_text_end[];
Heiko Carstensa581c2a2006-07-01 04:36:30 -070037extern char __start_rodata[], __end_rodata[];
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
Peter Oberparleiterb99b87f2009-06-17 16:28:03 -070039/* Start and end of .ctors section - used for constructor calls. */
40extern char __ctors_start[], __ctors_end[];
41
Geert Uytterhoeven7f8998c2014-10-09 15:30:30 -070042extern __visible const void __nosave_begin, __nosave_end;
43
James Bottomleydeac93d2008-09-03 20:43:36 -050044/* function descriptor handling (if any). Override
45 * in asm/sections.h */
46#ifndef dereference_function_descriptor
47#define dereference_function_descriptor(p) (p)
48#endif
49
Mike Frysinger00afe022009-09-22 16:44:14 -070050/* random extra sections (if any). Override
51 * in asm/sections.h */
52#ifndef arch_is_kernel_text
53static inline int arch_is_kernel_text(unsigned long addr)
54{
55 return 0;
56}
57#endif
58
59#ifndef arch_is_kernel_data
60static inline int arch_is_kernel_data(unsigned long addr)
61{
62 return 0;
63}
64#endif
65
Linus Torvalds1da177e2005-04-16 15:20:36 -070066#endif /* _ASM_GENERIC_SECTIONS_H_ */