sections.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef _ASM_GENERIC_SECTIONS_H_
  2. #define _ASM_GENERIC_SECTIONS_H_
  3. /* References to section boundaries */
  4. #include <linux/compiler.h>
  5. /*
  6. * Usage guidelines:
  7. * _text, _data: architecture specific, don't use them in arch-independent code
  8. * [_stext, _etext]: contains .text.* sections, may also contain .rodata.*
  9. * and/or .init.* sections
  10. * [_sdata, _edata]: contains .data.* sections, may also contain .rodata.*
  11. * and/or .init.* sections.
  12. * [__start_rodata, __end_rodata]: contains .rodata.* sections
  13. * [__init_begin, __init_end]: contains .init.* sections, but .init.text.*
  14. * may be out of this range on some architectures.
  15. * [_sinittext, _einittext]: contains .init.text.* sections
  16. * [__bss_start, __bss_stop]: contains BSS sections
  17. *
  18. * Following global variables are optional and may be unavailable on some
  19. * architectures and/or kernel configurations.
  20. * _text, _data
  21. * __kprobes_text_start, __kprobes_text_end
  22. * __entry_text_start, __entry_text_end
  23. * __ctors_start, __ctors_end
  24. */
  25. extern char _text[], _stext[], _etext[];
  26. extern char _data[], _sdata[], _edata[];
  27. extern char __bss_start[], __bss_stop[];
  28. extern char __init_begin[], __init_end[];
  29. extern char _sinittext[], _einittext[];
  30. extern char _end[];
  31. extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
  32. extern char __kprobes_text_start[], __kprobes_text_end[];
  33. extern char __entry_text_start[], __entry_text_end[];
  34. extern char __start_rodata[], __end_rodata[];
  35. /* Start and end of .ctors section - used for constructor calls. */
  36. extern char __ctors_start[], __ctors_end[];
  37. extern __visible const void __nosave_begin, __nosave_end;
  38. /* function descriptor handling (if any). Override
  39. * in asm/sections.h */
  40. #ifndef dereference_function_descriptor
  41. #define dereference_function_descriptor(p) (p)
  42. #endif
  43. /* random extra sections (if any). Override
  44. * in asm/sections.h */
  45. #ifndef arch_is_kernel_text
  46. static inline int arch_is_kernel_text(unsigned long addr)
  47. {
  48. return 0;
  49. }
  50. #endif
  51. #ifndef arch_is_kernel_data
  52. static inline int arch_is_kernel_data(unsigned long addr)
  53. {
  54. return 0;
  55. }
  56. #endif
  57. #endif /* _ASM_GENERIC_SECTIONS_H_ */