vmlinux.lds.S 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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 <linux/config.h>
  7. #include <asm/thread_info.h>
  8. #include <asm/memory.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. .init : { /* Init code and data */
  24. _stext = .;
  25. _sinittext = .;
  26. *(.init.text)
  27. _einittext = .;
  28. __proc_info_begin = .;
  29. *(.proc.info.init)
  30. __proc_info_end = .;
  31. __arch_info_begin = .;
  32. *(.arch.info.init)
  33. __arch_info_end = .;
  34. __tagtable_begin = .;
  35. *(.taglist.init)
  36. __tagtable_end = .;
  37. . = ALIGN(16);
  38. __setup_start = .;
  39. *(.init.setup)
  40. __setup_end = .;
  41. __early_begin = .;
  42. *(.early_param.init)
  43. __early_end = .;
  44. __initcall_start = .;
  45. *(.initcall1.init)
  46. *(.initcall2.init)
  47. *(.initcall3.init)
  48. *(.initcall4.init)
  49. *(.initcall5.init)
  50. *(.initcall6.init)
  51. *(.initcall7.init)
  52. __initcall_end = .;
  53. __con_initcall_start = .;
  54. *(.con_initcall.init)
  55. __con_initcall_end = .;
  56. __security_initcall_start = .;
  57. *(.security_initcall.init)
  58. __security_initcall_end = .;
  59. . = ALIGN(32);
  60. __initramfs_start = .;
  61. usr/built-in.o(.init.ramfs)
  62. __initramfs_end = .;
  63. . = ALIGN(64);
  64. __per_cpu_start = .;
  65. *(.data.percpu)
  66. __per_cpu_end = .;
  67. #ifndef CONFIG_XIP_KERNEL
  68. __init_begin = _stext;
  69. *(.init.data)
  70. . = ALIGN(4096);
  71. __init_end = .;
  72. #endif
  73. }
  74. /DISCARD/ : { /* Exit code and data */
  75. *(.exit.text)
  76. *(.exit.data)
  77. *(.exitcall.exit)
  78. #ifndef CONFIG_MMU
  79. *(.fixup)
  80. *(__ex_table)
  81. #endif
  82. }
  83. .text : { /* Real text segment */
  84. _text = .; /* Text and read-only data */
  85. *(.text)
  86. SCHED_TEXT
  87. LOCK_TEXT
  88. #ifdef CONFIG_MMU
  89. *(.fixup)
  90. #endif
  91. *(.gnu.warning)
  92. *(.rodata)
  93. *(.rodata.*)
  94. *(.glue_7)
  95. *(.glue_7t)
  96. *(.got) /* Global offset table */
  97. }
  98. RODATA
  99. _etext = .; /* End of text and rodata section */
  100. #ifdef CONFIG_XIP_KERNEL
  101. __data_loc = ALIGN(4); /* location in binary */
  102. . = PAGE_OFFSET + TEXT_OFFSET;
  103. #else
  104. . = ALIGN(THREAD_SIZE);
  105. __data_loc = .;
  106. #endif
  107. .data : AT(__data_loc) {
  108. __data_start = .; /* address in memory */
  109. /*
  110. * first, the init task union, aligned
  111. * to an 8192 byte boundary.
  112. */
  113. *(.init.task)
  114. #ifdef CONFIG_XIP_KERNEL
  115. . = ALIGN(4096);
  116. __init_begin = .;
  117. *(.init.data)
  118. . = ALIGN(4096);
  119. __init_end = .;
  120. #endif
  121. . = ALIGN(4096);
  122. __nosave_begin = .;
  123. *(.data.nosave)
  124. . = ALIGN(4096);
  125. __nosave_end = .;
  126. /*
  127. * then the cacheline aligned data
  128. */
  129. . = ALIGN(32);
  130. *(.data.cacheline_aligned)
  131. /*
  132. * The exception fixup table (might need resorting at runtime)
  133. */
  134. . = ALIGN(32);
  135. __start___ex_table = .;
  136. #ifdef CONFIG_MMU
  137. *(__ex_table)
  138. #endif
  139. __stop___ex_table = .;
  140. /*
  141. * and the usual data section
  142. */
  143. *(.data)
  144. CONSTRUCTORS
  145. _edata = .;
  146. }
  147. .bss : {
  148. __bss_start = .; /* BSS */
  149. *(.bss)
  150. *(COMMON)
  151. _end = .;
  152. }
  153. /* Stabs debugging sections. */
  154. .stab 0 : { *(.stab) }
  155. .stabstr 0 : { *(.stabstr) }
  156. .stab.excl 0 : { *(.stab.excl) }
  157. .stab.exclstr 0 : { *(.stab.exclstr) }
  158. .stab.index 0 : { *(.stab.index) }
  159. .stab.indexstr 0 : { *(.stab.indexstr) }
  160. .comment 0 : { *(.comment) }
  161. }
  162. /*
  163. * These must never be empty
  164. * If you have to comment these two assert statements out, your
  165. * binutils is too old (for other reasons as well)
  166. */
  167. ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
  168. ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")