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. 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. #ifdef CONFIG_BLK_DEV_INITRD
  53. . = ALIGN(32);
  54. __initramfs_start = .;
  55. usr/built-in.o(.init.ramfs)
  56. __initramfs_end = .;
  57. #endif
  58. . = ALIGN(64);
  59. __per_cpu_start = .;
  60. *(.data.percpu)
  61. __per_cpu_end = .;
  62. #ifndef CONFIG_XIP_KERNEL
  63. __init_begin = _stext;
  64. *(.init.data)
  65. . = ALIGN(4096);
  66. __init_end = .;
  67. #endif
  68. }
  69. /DISCARD/ : { /* Exit code and data */
  70. *(.exit.text)
  71. *(.exit.data)
  72. *(.exitcall.exit)
  73. #ifndef CONFIG_MMU
  74. *(.fixup)
  75. *(__ex_table)
  76. #endif
  77. }
  78. .text : { /* Real text segment */
  79. _text = .; /* Text and read-only data */
  80. __exception_text_start = .;
  81. *(.exception.text)
  82. __exception_text_end = .;
  83. *(.text)
  84. SCHED_TEXT
  85. LOCK_TEXT
  86. #ifdef CONFIG_MMU
  87. *(.fixup)
  88. #endif
  89. *(.gnu.warning)
  90. *(.rodata)
  91. *(.rodata.*)
  92. *(.glue_7)
  93. *(.glue_7t)
  94. *(.got) /* Global offset table */
  95. }
  96. RODATA
  97. _etext = .; /* End of text and rodata section */
  98. #ifdef CONFIG_XIP_KERNEL
  99. __data_loc = ALIGN(4); /* location in binary */
  100. . = PAGE_OFFSET + TEXT_OFFSET;
  101. #else
  102. . = ALIGN(THREAD_SIZE);
  103. __data_loc = .;
  104. #endif
  105. .data : AT(__data_loc) {
  106. __data_start = .; /* address in memory */
  107. /*
  108. * first, the init task union, aligned
  109. * to an 8192 byte boundary.
  110. */
  111. *(.init.task)
  112. #ifdef CONFIG_XIP_KERNEL
  113. . = ALIGN(4096);
  114. __init_begin = .;
  115. *(.init.data)
  116. . = ALIGN(4096);
  117. __init_end = .;
  118. #endif
  119. . = ALIGN(4096);
  120. __nosave_begin = .;
  121. *(.data.nosave)
  122. . = ALIGN(4096);
  123. __nosave_end = .;
  124. /*
  125. * then the cacheline aligned data
  126. */
  127. . = ALIGN(32);
  128. *(.data.cacheline_aligned)
  129. /*
  130. * The exception fixup table (might need resorting at runtime)
  131. */
  132. . = ALIGN(32);
  133. __start___ex_table = .;
  134. #ifdef CONFIG_MMU
  135. *(__ex_table)
  136. #endif
  137. __stop___ex_table = .;
  138. /*
  139. * and the usual data section
  140. */
  141. *(.data)
  142. CONSTRUCTORS
  143. _edata = .;
  144. }
  145. _edata_loc = __data_loc + SIZEOF(.data);
  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")