vmlinux.lds.S 3.5 KB

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