Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef _ASM_GENERIC_SECTIONS_H_ |
| 2 | #define _ASM_GENERIC_SECTIONS_H_ |
| 3 | |
| 4 | /* References to section boundaries */ |
| 5 | |
Jiang Liu | 1622d1a | 2013-07-03 15:03:33 -0700 | [diff] [blame] | 6 | /* |
| 7 | * Usage guidelines: |
| 8 | * _text, _data: architecture specific, don't use them in arch-independent code |
| 9 | * [_stext, _etext]: contains .text.* sections, may also contain .rodata.* |
| 10 | * and/or .init.* sections |
| 11 | * [_sdata, _edata]: contains .data.* sections, may also contain .rodata.* |
| 12 | * and/or .init.* sections. |
| 13 | * [__start_rodata, __end_rodata]: contains .rodata.* sections |
| 14 | * [__init_begin, __init_end]: contains .init.* sections, but .init.text.* |
| 15 | * may be out of this range on some architectures. |
| 16 | * [_sinittext, _einittext]: contains .init.text.* sections |
| 17 | * [__bss_start, __bss_stop]: contains BSS sections |
| 18 | * |
| 19 | * Following global variables are optional and may be unavailable on some |
| 20 | * architectures and/or kernel configurations. |
| 21 | * _text, _data |
| 22 | * __kprobes_text_start, __kprobes_text_end |
| 23 | * __entry_text_start, __entry_text_end |
| 24 | * __ctors_start, __ctors_end |
| 25 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | extern char _text[], _stext[], _etext[]; |
| 27 | extern char _data[], _sdata[], _edata[]; |
| 28 | extern char __bss_start[], __bss_stop[]; |
| 29 | extern char __init_begin[], __init_end[]; |
| 30 | extern char _sinittext[], _einittext[]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 31 | extern char _end[]; |
Tejun Heo | 3e5d8f9 | 2009-01-13 20:41:35 +0900 | [diff] [blame] | 32 | extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[]; |
Prasanna S Panchamukhi | d0aaff9 | 2005-09-06 15:19:26 -0700 | [diff] [blame] | 33 | extern char __kprobes_text_start[], __kprobes_text_end[]; |
Jiri Olsa | ea71454 | 2011-03-07 19:10:39 +0100 | [diff] [blame] | 34 | extern char __entry_text_start[], __entry_text_end[]; |
Heiko Carstens | a581c2a | 2006-07-01 04:36:30 -0700 | [diff] [blame] | 35 | extern char __start_rodata[], __end_rodata[]; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
Peter Oberparleiter | b99b87f | 2009-06-17 16:28:03 -0700 | [diff] [blame] | 37 | /* Start and end of .ctors section - used for constructor calls. */ |
| 38 | extern char __ctors_start[], __ctors_end[]; |
| 39 | |
James Bottomley | deac93d | 2008-09-03 20:43:36 -0500 | [diff] [blame] | 40 | /* function descriptor handling (if any). Override |
| 41 | * in asm/sections.h */ |
| 42 | #ifndef dereference_function_descriptor |
| 43 | #define dereference_function_descriptor(p) (p) |
| 44 | #endif |
| 45 | |
Mike Frysinger | 00afe02 | 2009-09-22 16:44:14 -0700 | [diff] [blame] | 46 | /* random extra sections (if any). Override |
| 47 | * in asm/sections.h */ |
| 48 | #ifndef arch_is_kernel_text |
| 49 | static inline int arch_is_kernel_text(unsigned long addr) |
| 50 | { |
| 51 | return 0; |
| 52 | } |
| 53 | #endif |
| 54 | |
| 55 | #ifndef arch_is_kernel_data |
| 56 | static inline int arch_is_kernel_data(unsigned long addr) |
| 57 | { |
| 58 | return 0; |
| 59 | } |
| 60 | #endif |
| 61 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | #endif /* _ASM_GENERIC_SECTIONS_H_ */ |