vmlinux.lds.S 3.6 KB

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