vmlinux.lds.S 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. #ifdef CONFIG_PPC64
  2. #define PROVIDE32(x) PROVIDE(__unused__##x)
  3. #else
  4. #define PROVIDE32(x) PROVIDE(x)
  5. #endif
  6. #include <asm/page.h>
  7. #include <asm-generic/vmlinux.lds.h>
  8. #include <asm/cache.h>
  9. ENTRY(_stext)
  10. #ifdef CONFIG_PPC64
  11. OUTPUT_ARCH(powerpc:common64)
  12. jiffies = jiffies_64;
  13. #else
  14. OUTPUT_ARCH(powerpc:common)
  15. jiffies = jiffies_64 + 4;
  16. #endif
  17. SECTIONS
  18. {
  19. /* Sections to be discarded. */
  20. /DISCARD/ : {
  21. *(.exitcall.exit)
  22. EXIT_DATA
  23. }
  24. . = KERNELBASE;
  25. /*
  26. * Text, read only data and other permanent read-only sections
  27. */
  28. /* Text and gots */
  29. .text : {
  30. ALIGN_FUNCTION();
  31. *(.text.head)
  32. _text = .;
  33. *(.text .fixup .text.init.refok .exit.text.refok)
  34. SCHED_TEXT
  35. LOCK_TEXT
  36. KPROBES_TEXT
  37. #ifdef CONFIG_PPC32
  38. *(.got1)
  39. __got2_start = .;
  40. *(.got2)
  41. __got2_end = .;
  42. #endif /* CONFIG_PPC32 */
  43. . = ALIGN(PAGE_SIZE);
  44. _etext = .;
  45. PROVIDE32 (etext = .);
  46. }
  47. /* Read-only data */
  48. RODATA
  49. /* Exception & bug tables */
  50. __ex_table : {
  51. __start___ex_table = .;
  52. *(__ex_table)
  53. __stop___ex_table = .;
  54. }
  55. NOTES
  56. BUG_TABLE
  57. /*
  58. * Init sections discarded at runtime
  59. */
  60. . = ALIGN(PAGE_SIZE);
  61. __init_begin = .;
  62. .init.text : {
  63. _sinittext = .;
  64. INIT_TEXT
  65. _einittext = .;
  66. }
  67. /* .exit.text is discarded at runtime, not link time,
  68. * to deal with references from __bug_table
  69. */
  70. .exit.text : {
  71. EXIT_TEXT
  72. }
  73. .init.data : {
  74. INIT_DATA
  75. __vtop_table_begin = .;
  76. *(.vtop_fixup);
  77. __vtop_table_end = .;
  78. __ptov_table_begin = .;
  79. *(.ptov_fixup);
  80. __ptov_table_end = .;
  81. #ifdef CONFIG_PPC_ISERIES
  82. __dt_strings_start = .;
  83. *(.dt_strings);
  84. __dt_strings_end = .;
  85. #endif
  86. }
  87. . = ALIGN(16);
  88. .init.setup : {
  89. __setup_start = .;
  90. *(.init.setup)
  91. __setup_end = .;
  92. }
  93. .initcall.init : {
  94. __initcall_start = .;
  95. INITCALLS
  96. __initcall_end = .;
  97. }
  98. .con_initcall.init : {
  99. __con_initcall_start = .;
  100. *(.con_initcall.init)
  101. __con_initcall_end = .;
  102. }
  103. SECURITY_INIT
  104. . = ALIGN(8);
  105. __ftr_fixup : {
  106. __start___ftr_fixup = .;
  107. *(__ftr_fixup)
  108. __stop___ftr_fixup = .;
  109. }
  110. #ifdef CONFIG_PPC64
  111. . = ALIGN(8);
  112. __fw_ftr_fixup : {
  113. __start___fw_ftr_fixup = .;
  114. *(__fw_ftr_fixup)
  115. __stop___fw_ftr_fixup = .;
  116. }
  117. #endif
  118. #ifdef CONFIG_BLK_DEV_INITRD
  119. . = ALIGN(PAGE_SIZE);
  120. .init.ramfs : {
  121. __initramfs_start = .;
  122. *(.init.ramfs)
  123. __initramfs_end = .;
  124. }
  125. #endif
  126. . = ALIGN(PAGE_SIZE);
  127. .data.percpu : {
  128. __per_cpu_start = .;
  129. *(.data.percpu)
  130. *(.data.percpu.shared_aligned)
  131. __per_cpu_end = .;
  132. }
  133. . = ALIGN(8);
  134. .machine.desc : {
  135. __machine_desc_start = . ;
  136. *(.machine.desc)
  137. __machine_desc_end = . ;
  138. }
  139. /* freed after init ends here */
  140. . = ALIGN(PAGE_SIZE);
  141. __init_end = .;
  142. /*
  143. * And now the various read/write data
  144. */
  145. . = ALIGN(PAGE_SIZE);
  146. _sdata = .;
  147. #ifdef CONFIG_PPC32
  148. .data :
  149. {
  150. DATA_DATA
  151. *(.sdata)
  152. *(.got.plt) *(.got)
  153. }
  154. #else
  155. .data : {
  156. DATA_DATA
  157. *(.data.rel*)
  158. *(.toc1)
  159. *(.branch_lt)
  160. }
  161. .opd : {
  162. *(.opd)
  163. }
  164. .got : {
  165. __toc_start = .;
  166. *(.got)
  167. *(.toc)
  168. }
  169. #endif
  170. . = ALIGN(PAGE_SIZE);
  171. _edata = .;
  172. PROVIDE32 (edata = .);
  173. /* The initial task and kernel stack */
  174. #ifdef CONFIG_PPC32
  175. . = ALIGN(8192);
  176. #else
  177. . = ALIGN(16384);
  178. #endif
  179. .data.init_task : {
  180. *(.data.init_task)
  181. }
  182. . = ALIGN(PAGE_SIZE);
  183. .data.page_aligned : {
  184. *(.data.page_aligned)
  185. }
  186. .data.cacheline_aligned : {
  187. *(.data.cacheline_aligned)
  188. }
  189. . = ALIGN(L1_CACHE_BYTES);
  190. .data.read_mostly : {
  191. *(.data.read_mostly)
  192. }
  193. . = ALIGN(PAGE_SIZE);
  194. __data_nosave : {
  195. __nosave_begin = .;
  196. *(.data.nosave)
  197. . = ALIGN(PAGE_SIZE);
  198. __nosave_end = .;
  199. }
  200. /*
  201. * And finally the bss
  202. */
  203. .bss : {
  204. __bss_start = .;
  205. *(.sbss) *(.scommon)
  206. *(.dynbss)
  207. *(.bss)
  208. *(COMMON)
  209. __bss_stop = .;
  210. }
  211. . = ALIGN(PAGE_SIZE);
  212. _end = . ;
  213. PROVIDE32 (end = .);
  214. }