vmlinux.lds.S 3.5 KB

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