sections.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * Copyright (c) 2011 The Chromium OS Authors.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License as
  6. * published by the Free Software Foundation; either version 2 of
  7. * the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  17. * MA 02111-1307 USA
  18. */
  19. /* Taken from Linux kernel, commit f56c3196 */
  20. #ifndef _ASM_GENERIC_SECTIONS_H_
  21. #define _ASM_GENERIC_SECTIONS_H_
  22. /* References to section boundaries */
  23. extern char _text[], _stext[], _etext[];
  24. extern char _data[], _sdata[], _edata[];
  25. extern char __bss_start[], __bss_stop[];
  26. extern char __init_begin[], __init_end[];
  27. extern char _sinittext[], _einittext[];
  28. extern char _end[], _init[];
  29. extern char __per_cpu_load[], __per_cpu_start[], __per_cpu_end[];
  30. extern char __kprobes_text_start[], __kprobes_text_end[];
  31. extern char __entry_text_start[], __entry_text_end[];
  32. extern char __initdata_begin[], __initdata_end[];
  33. extern char __start_rodata[], __end_rodata[];
  34. /* Start and end of .ctors section - used for constructor calls. */
  35. extern char __ctors_start[], __ctors_end[];
  36. /* function descriptor handling (if any). Override
  37. * in asm/sections.h */
  38. #ifndef dereference_function_descriptor
  39. #define dereference_function_descriptor(p) (p)
  40. #endif
  41. /* random extra sections (if any). Override
  42. * in asm/sections.h */
  43. #ifndef arch_is_kernel_text
  44. static inline int arch_is_kernel_text(unsigned long addr)
  45. {
  46. return 0;
  47. }
  48. #endif
  49. #ifndef arch_is_kernel_data
  50. static inline int arch_is_kernel_data(unsigned long addr)
  51. {
  52. return 0;
  53. }
  54. #endif
  55. /* U-Boot-specific things begin here */
  56. /* Start of U-Boot text region */
  57. extern char __text_start[];
  58. /* This marks the end of the text region which must be relocated */
  59. extern char __image_copy_end[];
  60. /*
  61. * This is the U-Boot entry point - prior to relocation it should be same
  62. * as __text_start
  63. */
  64. extern void _start(void);
  65. /*
  66. * ARM needs to use offsets for symbols, since the values of some symbols
  67. * are not resolved prior to relocation (and are just 0). Maybe this can be
  68. * resolved, or maybe other architectures are similar, iwc this should be
  69. * promoted to an architecture option.
  70. */
  71. #ifdef CONFIG_ARM
  72. #define CONFIG_SYS_SYM_OFFSETS
  73. #endif
  74. #ifdef CONFIG_SYS_SYM_OFFSETS
  75. /* Start/end of the relocation entries, as an offset from _start */
  76. extern ulong _rel_dyn_start_ofs;
  77. extern ulong _rel_dyn_end_ofs;
  78. /* End of the region to be relocated, as an offset form _start */
  79. extern ulong _image_copy_end_ofs;
  80. extern ulong _bss_start_ofs; /* BSS start relative to _start */
  81. extern ulong _bss_end_ofs; /* BSS end relative to _start */
  82. extern ulong _end_ofs; /* end of image relative to _start */
  83. extern ulong _TEXT_BASE; /* code start */
  84. #else /* don't use offsets: */
  85. /* Exports from the Linker Script */
  86. extern ulong __data_end;
  87. extern ulong __rel_dyn_start;
  88. extern ulong __rel_dyn_end;
  89. extern ulong __bss_end;
  90. extern ulong _TEXT_BASE; /* code start */
  91. #endif
  92. #endif /* _ASM_GENERIC_SECTIONS_H_ */