vmlinux.lds.S 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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. #ifdef CONFIG_XIP_KERNEL
  17. #define TEXTADDR XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR)
  18. #else
  19. #define TEXTADDR KERNEL_RAM_ADDR
  20. #endif
  21. SECTIONS
  22. {
  23. . = TEXTADDR;
  24. .init : { /* Init code and data */
  25. _stext = .;
  26. _sinittext = .;
  27. *(.init.text)
  28. _einittext = .;
  29. __proc_info_begin = .;
  30. *(.proc.info.init)
  31. __proc_info_end = .;
  32. __arch_info_begin = .;
  33. *(.arch.info.init)
  34. __arch_info_end = .;
  35. __tagtable_begin = .;
  36. *(.taglist.init)
  37. __tagtable_end = .;
  38. . = ALIGN(16);
  39. __setup_start = .;
  40. *(.init.setup)
  41. __setup_end = .;
  42. __early_begin = .;
  43. *(.early_param.init)
  44. __early_end = .;
  45. __initcall_start = .;
  46. *(.initcall1.init)
  47. *(.initcall2.init)
  48. *(.initcall3.init)
  49. *(.initcall4.init)
  50. *(.initcall5.init)
  51. *(.initcall6.init)
  52. *(.initcall7.init)
  53. __initcall_end = .;
  54. __con_initcall_start = .;
  55. *(.con_initcall.init)
  56. __con_initcall_end = .;
  57. __security_initcall_start = .;
  58. *(.security_initcall.init)
  59. __security_initcall_end = .;
  60. . = ALIGN(32);
  61. __initramfs_start = .;
  62. usr/built-in.o(.init.ramfs)
  63. __initramfs_end = .;
  64. . = ALIGN(64);
  65. __per_cpu_start = .;
  66. *(.data.percpu)
  67. __per_cpu_end = .;
  68. #ifndef CONFIG_XIP_KERNEL
  69. __init_begin = _stext;
  70. *(.init.data)
  71. . = ALIGN(4096);
  72. __init_end = .;
  73. #endif
  74. }
  75. /DISCARD/ : { /* Exit code and data */
  76. *(.exit.text)
  77. *(.exit.data)
  78. *(.exitcall.exit)
  79. }
  80. .text : { /* Real text segment */
  81. _text = .; /* Text and read-only data */
  82. *(.text)
  83. SCHED_TEXT
  84. LOCK_TEXT
  85. *(.fixup)
  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. . = KERNEL_RAM_ADDR;
  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. *(__ex_table)
  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. /* those must never be empty */
  156. ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
  157. ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")