vmlinux.lds.S 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. /* ld script to make ARM Linux kernel
  2. * taken from the i386 version by Russell King
  3. * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
  4. */
  5. #include <asm-generic/vmlinux.lds.h>
  6. #include <asm/thread_info.h>
  7. #include <asm/memory.h>
  8. OUTPUT_ARCH(arm)
  9. ENTRY(stext)
  10. #ifndef __ARMEB__
  11. jiffies = jiffies_64;
  12. #else
  13. jiffies = jiffies_64 + 4;
  14. #endif
  15. SECTIONS
  16. {
  17. #ifdef CONFIG_XIP_KERNEL
  18. . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
  19. #else
  20. . = PAGE_OFFSET + TEXT_OFFSET;
  21. #endif
  22. .text.head : {
  23. _stext = .;
  24. _sinittext = .;
  25. *(.text.head)
  26. }
  27. .init : { /* Init code and data */
  28. INIT_TEXT
  29. _einittext = .;
  30. __proc_info_begin = .;
  31. *(.proc.info.init)
  32. __proc_info_end = .;
  33. __arch_info_begin = .;
  34. *(.arch.info.init)
  35. __arch_info_end = .;
  36. __tagtable_begin = .;
  37. *(.taglist.init)
  38. __tagtable_end = .;
  39. . = ALIGN(16);
  40. __setup_start = .;
  41. *(.init.setup)
  42. __setup_end = .;
  43. __early_begin = .;
  44. *(.early_param.init)
  45. __early_end = .;
  46. __initcall_start = .;
  47. INITCALLS
  48. __initcall_end = .;
  49. __con_initcall_start = .;
  50. *(.con_initcall.init)
  51. __con_initcall_end = .;
  52. __security_initcall_start = .;
  53. *(.security_initcall.init)
  54. __security_initcall_end = .;
  55. #ifdef CONFIG_BLK_DEV_INITRD
  56. . = ALIGN(32);
  57. __initramfs_start = .;
  58. usr/built-in.o(.init.ramfs)
  59. __initramfs_end = .;
  60. #endif
  61. . = ALIGN(4096);
  62. __per_cpu_load = .;
  63. __per_cpu_start = .;
  64. *(.data.percpu.page_aligned)
  65. *(.data.percpu)
  66. *(.data.percpu.shared_aligned)
  67. __per_cpu_end = .;
  68. #ifndef CONFIG_XIP_KERNEL
  69. __init_begin = _stext;
  70. INIT_DATA
  71. . = ALIGN(4096);
  72. __init_end = .;
  73. #endif
  74. }
  75. /DISCARD/ : { /* Exit code and data */
  76. EXIT_TEXT
  77. EXIT_DATA
  78. *(.exitcall.exit)
  79. *(.ARM.exidx.exit.text)
  80. *(.ARM.extab.exit.text)
  81. #ifndef CONFIG_HOTPLUG_CPU
  82. *(.ARM.exidx.cpuexit.text)
  83. *(.ARM.extab.cpuexit.text)
  84. #endif
  85. #ifndef CONFIG_HOTPLUG
  86. *(.ARM.exidx.devexit.text)
  87. *(.ARM.extab.devexit.text)
  88. #endif
  89. #ifndef CONFIG_MMU
  90. *(.fixup)
  91. *(__ex_table)
  92. #endif
  93. }
  94. .text : { /* Real text segment */
  95. _text = .; /* Text and read-only data */
  96. __exception_text_start = .;
  97. *(.exception.text)
  98. __exception_text_end = .;
  99. TEXT_TEXT
  100. SCHED_TEXT
  101. LOCK_TEXT
  102. KPROBES_TEXT
  103. #ifdef CONFIG_MMU
  104. *(.fixup)
  105. #endif
  106. *(.gnu.warning)
  107. *(.rodata)
  108. *(.rodata.*)
  109. *(.glue_7)
  110. *(.glue_7t)
  111. *(.got) /* Global offset table */
  112. }
  113. RODATA
  114. _etext = .; /* End of text and rodata section */
  115. #ifdef CONFIG_ARM_UNWIND
  116. /*
  117. * Stack unwinding tables
  118. */
  119. . = ALIGN(8);
  120. .ARM.unwind_idx : {
  121. __start_unwind_idx = .;
  122. *(.ARM.exidx*)
  123. __stop_unwind_idx = .;
  124. }
  125. .ARM.unwind_tab : {
  126. __start_unwind_tab = .;
  127. *(.ARM.extab*)
  128. __stop_unwind_tab = .;
  129. }
  130. #endif
  131. #ifdef CONFIG_XIP_KERNEL
  132. __data_loc = ALIGN(4); /* location in binary */
  133. . = PAGE_OFFSET + TEXT_OFFSET;
  134. #else
  135. . = ALIGN(THREAD_SIZE);
  136. __data_loc = .;
  137. #endif
  138. .data : AT(__data_loc) {
  139. _data = .; /* address in memory */
  140. _sdata = .;
  141. /*
  142. * first, the init task union, aligned
  143. * to an 8192 byte boundary.
  144. */
  145. *(.data.init_task)
  146. #ifdef CONFIG_XIP_KERNEL
  147. . = ALIGN(4096);
  148. __init_begin = .;
  149. INIT_DATA
  150. . = ALIGN(4096);
  151. __init_end = .;
  152. #endif
  153. . = ALIGN(4096);
  154. __nosave_begin = .;
  155. *(.data.nosave)
  156. . = ALIGN(4096);
  157. __nosave_end = .;
  158. /*
  159. * then the cacheline aligned data
  160. */
  161. . = ALIGN(32);
  162. *(.data.cacheline_aligned)
  163. /*
  164. * The exception fixup table (might need resorting at runtime)
  165. */
  166. . = ALIGN(32);
  167. __start___ex_table = .;
  168. #ifdef CONFIG_MMU
  169. *(__ex_table)
  170. #endif
  171. __stop___ex_table = .;
  172. /*
  173. * and the usual data section
  174. */
  175. DATA_DATA
  176. CONSTRUCTORS
  177. _edata = .;
  178. }
  179. _edata_loc = __data_loc + SIZEOF(.data);
  180. .bss : {
  181. __bss_start = .; /* BSS */
  182. *(.bss)
  183. *(COMMON)
  184. __bss_stop = .;
  185. _end = .;
  186. }
  187. /* Stabs debugging sections. */
  188. .stab 0 : { *(.stab) }
  189. .stabstr 0 : { *(.stabstr) }
  190. .stab.excl 0 : { *(.stab.excl) }
  191. .stab.exclstr 0 : { *(.stab.exclstr) }
  192. .stab.index 0 : { *(.stab.index) }
  193. .stab.indexstr 0 : { *(.stab.indexstr) }
  194. .comment 0 : { *(.comment) }
  195. }
  196. /*
  197. * These must never be empty
  198. * If you have to comment these two assert statements out, your
  199. * binutils is too old (for other reasons as well)
  200. */
  201. ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
  202. ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")