vmlinux.lds.S 3.7 KB

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