sections.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Copyright (c) 2011 The Chromium OS Authors.
  4. */
  5. /* Taken from Linux kernel, commit f56c3196 */
  6. #ifndef _ASM_GENERIC_SECTIONS_H_
  7. #define _ASM_GENERIC_SECTIONS_H_
  8. #include <linux/types.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. extern char __efi_helloworld_begin[];
  22. extern char __efi_helloworld_end[];
  23. extern char __efi_var_file_begin[];
  24. extern char __efi_var_file_end[];
  25. /* Start and end of .ctors section - used for constructor calls. */
  26. extern char __ctors_start[], __ctors_end[];
  27. /* function descriptor handling (if any). Override
  28. * in asm/sections.h */
  29. #ifndef dereference_function_descriptor
  30. #define dereference_function_descriptor(p) (p)
  31. #endif
  32. /* random extra sections (if any). Override
  33. * in asm/sections.h */
  34. #ifndef arch_is_kernel_text
  35. static inline int arch_is_kernel_text(unsigned long addr)
  36. {
  37. return 0;
  38. }
  39. #endif
  40. #ifndef arch_is_kernel_data
  41. static inline int arch_is_kernel_data(unsigned long addr)
  42. {
  43. return 0;
  44. }
  45. #endif
  46. /* U-Boot-specific things begin here */
  47. /* Start of U-Boot text region */
  48. extern char __text_start[];
  49. /* This marks the end of the text region which must be relocated */
  50. extern char __image_copy_end[];
  51. /*
  52. * This is the U-Boot entry point - prior to relocation it should be same
  53. * as __text_start
  54. */
  55. extern void _start(void);
  56. /*
  57. * ARM defines its symbols as char[]. Other arches define them as ulongs.
  58. */
  59. #ifdef CONFIG_ARM
  60. extern char __bss_start[];
  61. extern char __bss_end[];
  62. extern char __image_copy_start[];
  63. extern char __image_copy_end[];
  64. extern char _image_binary_end[];
  65. extern char __rel_dyn_start[];
  66. extern char __rel_dyn_end[];
  67. #else /* don't use offsets: */
  68. /* Exports from the Linker Script */
  69. extern ulong __data_end;
  70. extern ulong __rel_dyn_start;
  71. extern ulong __rel_dyn_end;
  72. extern ulong __bss_end;
  73. extern ulong _image_binary_end;
  74. extern ulong _TEXT_BASE; /* code start */
  75. #endif
  76. #endif /* _ASM_GENERIC_SECTIONS_H_ */