vmlinux.lds.S 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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_start = .;
  63. *(.data.percpu)
  64. *(.data.percpu.shared_aligned)
  65. __per_cpu_end = .;
  66. #ifndef CONFIG_XIP_KERNEL
  67. __init_begin = _stext;
  68. *(.init.data)
  69. . = ALIGN(4096);
  70. __init_end = .;
  71. #endif
  72. }
  73. /DISCARD/ : { /* Exit code and data */
  74. *(.exit.text)
  75. *(.exit.data)
  76. *(.exitcall.exit)
  77. #ifndef CONFIG_MMU
  78. *(.fixup)
  79. *(__ex_table)
  80. #endif
  81. }
  82. .text : { /* Real text segment */
  83. _text = .; /* Text and read-only data */
  84. __exception_text_start = .;
  85. *(.exception.text)
  86. __exception_text_end = .;
  87. TEXT_TEXT
  88. SCHED_TEXT
  89. LOCK_TEXT
  90. #ifdef CONFIG_MMU
  91. *(.fixup)
  92. #endif
  93. *(.gnu.warning)
  94. *(.rodata)
  95. *(.rodata.*)
  96. *(.glue_7)
  97. *(.glue_7t)
  98. *(.got) /* Global offset table */
  99. }
  100. RODATA
  101. _etext = .; /* End of text and rodata section */
  102. #ifdef CONFIG_XIP_KERNEL
  103. __data_loc = ALIGN(4); /* location in binary */
  104. . = PAGE_OFFSET + TEXT_OFFSET;
  105. #else
  106. . = ALIGN(THREAD_SIZE);
  107. __data_loc = .;
  108. #endif
  109. .data : AT(__data_loc) {
  110. __data_start = .; /* address in memory */
  111. /*
  112. * first, the init task union, aligned
  113. * to an 8192 byte boundary.
  114. */
  115. *(.data.init_task)
  116. #ifdef CONFIG_XIP_KERNEL
  117. . = ALIGN(4096);
  118. __init_begin = .;
  119. *(.init.data)
  120. . = ALIGN(4096);
  121. __init_end = .;
  122. #endif
  123. . = ALIGN(4096);
  124. __nosave_begin = .;
  125. *(.data.nosave)
  126. . = ALIGN(4096);
  127. __nosave_end = .;
  128. /*
  129. * then the cacheline aligned data
  130. */
  131. . = ALIGN(32);
  132. *(.data.cacheline_aligned)
  133. /*
  134. * The exception fixup table (might need resorting at runtime)
  135. */
  136. . = ALIGN(32);
  137. __start___ex_table = .;
  138. #ifdef CONFIG_MMU
  139. *(__ex_table)
  140. #endif
  141. __stop___ex_table = .;
  142. /*
  143. * and the usual data section
  144. */
  145. DATA_DATA
  146. CONSTRUCTORS
  147. _edata = .;
  148. }
  149. _edata_loc = __data_loc + SIZEOF(.data);
  150. .bss : {
  151. __bss_start = .; /* BSS */
  152. *(.bss)
  153. *(COMMON)
  154. _end = .;
  155. }
  156. /* Stabs debugging sections. */
  157. .stab 0 : { *(.stab) }
  158. .stabstr 0 : { *(.stabstr) }
  159. .stab.excl 0 : { *(.stab.excl) }
  160. .stab.exclstr 0 : { *(.stab.exclstr) }
  161. .stab.index 0 : { *(.stab.index) }
  162. .stab.indexstr 0 : { *(.stab.indexstr) }
  163. .comment 0 : { *(.comment) }
  164. }
  165. /*
  166. * These must never be empty
  167. * If you have to comment these two assert statements out, your
  168. * binutils is too old (for other reasons as well)
  169. */
  170. ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
  171. ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")