vmlinux.lds.S 3.4 KB

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