vmlinux.lds.S 4.3 KB

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