vmlinux.lds.S 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  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)
  25. __proc_info_end = .;
  26. __arch_info_begin = .;
  27. *(.arch.info)
  28. __arch_info_end = .;
  29. __tagtable_begin = .;
  30. *(.taglist)
  31. __tagtable_end = .;
  32. . = ALIGN(16);
  33. __setup_start = .;
  34. *(.init.setup)
  35. __setup_end = .;
  36. __early_begin = .;
  37. *(__early_param)
  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. . = ALIGN(16);
  88. __ex_table : { /* Exception table */
  89. __start___ex_table = .;
  90. *(__ex_table)
  91. __stop___ex_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. . = DATAADDR;
  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. * and the usual data section
  128. */
  129. *(.data)
  130. CONSTRUCTORS
  131. _edata = .;
  132. }
  133. .bss : {
  134. __bss_start = .; /* BSS */
  135. *(.bss)
  136. *(COMMON)
  137. _end = .;
  138. }
  139. /* Stabs debugging sections. */
  140. .stab 0 : { *(.stab) }
  141. .stabstr 0 : { *(.stabstr) }
  142. .stab.excl 0 : { *(.stab.excl) }
  143. .stab.exclstr 0 : { *(.stab.exclstr) }
  144. .stab.index 0 : { *(.stab.index) }
  145. .stab.indexstr 0 : { *(.stab.indexstr) }
  146. .comment 0 : { *(.comment) }
  147. }
  148. /* those must never be empty */
  149. ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support")
  150. ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined")