vmlinux.lds.S 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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. 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. . = TEXTADDR;
  18. .init : { /* Init code and data */
  19. _stext = .;
  20. _sinittext = .;
  21. *(.init.text)
  22. _einittext = .;
  23. __proc_info_begin = .;
  24. *(.proc.info.init)
  25. __proc_info_end = .;
  26. __arch_info_begin = .;
  27. *(.arch.info.init)
  28. __arch_info_end = .;
  29. __tagtable_begin = .;
  30. *(.taglist.init)
  31. __tagtable_end = .;
  32. . = ALIGN(16);
  33. __setup_start = .;
  34. *(.init.setup)
  35. __setup_end = .;
  36. __early_begin = .;
  37. *(.early_param.init)
  38. __early_end = .;
  39. __initcall_start = .;
  40. *(.initcall1.init)
  41. *(.initcall2.init)
  42. *(.initcall3.init)
  43. *(.initcall4.init)
  44. *(.initcall5.init)
  45. *(.initcall6.init)
  46. *(.initcall7.init)
  47. __initcall_end = .;
  48. __con_initcall_start = .;
  49. *(.con_initcall.init)
  50. __con_initcall_end = .;
  51. __security_initcall_start = .;
  52. *(.security_initcall.init)
  53. __security_initcall_end = .;
  54. . = ALIGN(32);
  55. __initramfs_start = .;
  56. usr/built-in.o(.init.ramfs)
  57. __initramfs_end = .;
  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. }
  74. .text : { /* Real text segment */
  75. _text = .; /* Text and read-only data */
  76. *(.text)
  77. SCHED_TEXT
  78. LOCK_TEXT
  79. *(.fixup)
  80. *(.gnu.warning)
  81. *(.rodata)
  82. *(.rodata.*)
  83. *(.glue_7)
  84. *(.glue_7t)
  85. *(.got) /* Global offset table */
  86. }
  87. RODATA
  88. _etext = .; /* End of text and rodata section */
  89. #ifdef CONFIG_XIP_KERNEL
  90. __data_loc = ALIGN(4); /* location in binary */
  91. . = DATAADDR;
  92. #else
  93. . = ALIGN(THREAD_SIZE);
  94. __data_loc = .;
  95. #endif
  96. .data : AT(__data_loc) {
  97. __data_start = .; /* address in memory */
  98. /*
  99. * first, the init task union, aligned
  100. * to an 8192 byte boundary.
  101. */
  102. *(.init.task)
  103. #ifdef CONFIG_XIP_KERNEL
  104. . = ALIGN(4096);
  105. __init_begin = .;
  106. *(.init.data)
  107. . = ALIGN(4096);
  108. __init_end = .;
  109. #endif
  110. . = ALIGN(4096);
  111. __nosave_begin = .;
  112. *(.data.nosave)
  113. . = ALIGN(4096);
  114. __nosave_end = .;
  115. /*
  116. * then the cacheline aligned data
  117. */
  118. . = ALIGN(32);
  119. *(.data.cacheline_aligned)
  120. /*
  121. * The exception fixup table (might need resorting at runtime)
  122. */
  123. . = ALIGN(32);
  124. __start___ex_table = .;
  125. *(__ex_table)
  126. __stop___ex_table = .;
  127. /*
  128. * and the usual data section
  129. */
  130. *(.data)
  131. CONSTRUCTORS
  132. _edata = .;
  133. }
  134. .bss : {
  135. __bss_start = .; /* BSS */
  136. *(.bss)
  137. *(COMMON)
  138. _end = .;
  139. }
  140. /* Stabs debugging sections. */
  141. .stab 0 : { *(.stab) }
  142. .stabstr 0 : { *(.stabstr) }
  143. .stab.excl 0 : { *(.stab.excl) }
  144. .stab.exclstr 0 : { *(.stab.exclstr) }
  145. .stab.index 0 : { *(.stab.index) }
  146. .stab.indexstr 0 : { *(.stab.indexstr) }
  147. .comment 0 : { *(.comment) }
  148. }
  149. /* those must never be empty */
  150. ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
  151. ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")