sections.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * Copyright (c) 2011 The Chromium OS Authors.
  3. *
  4. * SPDX-License-Identifier: GPL-2.0+
  5. */
  6. /* Taken from Linux kernel, commit f56c3196 */
  7. #ifndef _ASM_GENERIC_SECTIONS_H_
  8. #define _ASM_GENERIC_SECTIONS_H_
  9. /* References to section boundaries */
  10. extern char _text[], _stext[], _etext[];
  11. extern char _data[], _sdata[], _edata[];
  12. extern char __bss_start[], __bss_stop[];
  13. extern char __init_begin[], __init_end[];
  14. extern char _sinittext[], _einittext[];
  15. extern char _end[], _init[];
  16. extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
  17. extern char __kprobes_text_start[], __kprobes_text_end[];
  18. extern char __entry_text_start[], __entry_text_end[];
  19. extern char __initdata_begin[], __initdata_end[];
  20. extern char __start_rodata[], __end_rodata[];
  21. /* Start and end of .ctors section - used for constructor calls. */
  22. extern char __ctors_start[], __ctors_end[];
  23. /* function descriptor handling (if any). Override
  24. * in asm/sections.h */
  25. #ifndef dereference_function_descriptor
  26. #define dereference_function_descriptor(p) (p)
  27. #endif
  28. /* random extra sections (if any). Override
  29. * in asm/sections.h */
  30. #ifndef arch_is_kernel_text
  31. static inline int arch_is_kernel_text(unsigned long addr)
  32. {
  33. return 0;
  34. }
  35. #endif
  36. #ifndef arch_is_kernel_data
  37. static inline int arch_is_kernel_data(unsigned long addr)
  38. {
  39. return 0;
  40. }
  41. #endif
  42. /* U-Boot-specific things begin here */
  43. /* Start of U-Boot text region */
  44. extern char __text_start[];
  45. /* This marks the end of the text region which must be relocated */
  46. extern char __image_copy_end[];
  47. /*
  48. * This is the U-Boot entry point - prior to relocation it should be same
  49. * as __text_start
  50. */
  51. extern void _start(void);
  52. /*
  53. * ARM defines its symbols as char[]. Other arches define them as ulongs.
  54. */
  55. #ifdef CONFIG_ARM
  56. extern char __bss_start[];
  57. extern char __bss_end[];
  58. extern char __image_copy_start[];
  59. extern char __image_copy_end[];
  60. extern char __rel_dyn_start[];
  61. extern char __rel_dyn_end[];
  62. #else /* don't use offsets: */
  63. /* Exports from the Linker Script */
  64. extern ulong __data_end;
  65. extern ulong __rel_dyn_start;
  66. extern ulong __rel_dyn_end;
  67. extern ulong __bss_end;
  68. extern ulong _TEXT_BASE; /* code start */
  69. #endif
  70. #endif /* _ASM_GENERIC_SECTIONS_H_ */