vmlinux.lds.S 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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. . = ALIGN(PAGE_SIZE);
  117. .init.ramfs : {
  118. __initramfs_start = .;
  119. *(.init.ramfs)
  120. __initramfs_end = .;
  121. }
  122. #ifdef CONFIG_PPC32
  123. . = ALIGN(32);
  124. #else
  125. . = ALIGN(128);
  126. #endif
  127. .data.percpu : {
  128. __per_cpu_start = .;
  129. *(.data.percpu)
  130. __per_cpu_end = .;
  131. }
  132. . = ALIGN(8);
  133. .machine.desc : {
  134. __machine_desc_start = . ;
  135. *(.machine.desc)
  136. __machine_desc_end = . ;
  137. }
  138. /* freed after init ends here */
  139. . = ALIGN(PAGE_SIZE);
  140. __init_end = .;
  141. /*
  142. * And now the various read/write data
  143. */
  144. . = ALIGN(PAGE_SIZE);
  145. _sdata = .;
  146. #ifdef CONFIG_PPC32
  147. .data :
  148. {
  149. *(.data)
  150. *(.sdata)
  151. *(.got.plt) *(.got)
  152. }
  153. #else
  154. .data : {
  155. *(.data .data.rel* .toc1)
  156. *(.branch_lt)
  157. }
  158. .opd : {
  159. *(.opd)
  160. }
  161. .got : {
  162. __toc_start = .;
  163. *(.got)
  164. *(.toc)
  165. }
  166. #endif
  167. . = ALIGN(PAGE_SIZE);
  168. _edata = .;
  169. PROVIDE32 (edata = .);
  170. /* The initial task and kernel stack */
  171. #ifdef CONFIG_PPC32
  172. . = ALIGN(8192);
  173. #else
  174. . = ALIGN(16384);
  175. #endif
  176. .data.init_task : {
  177. *(.data.init_task)
  178. }
  179. . = ALIGN(PAGE_SIZE);
  180. .data.page_aligned : {
  181. *(.data.page_aligned)
  182. }
  183. .data.cacheline_aligned : {
  184. *(.data.cacheline_aligned)
  185. }
  186. . = ALIGN(PAGE_SIZE);
  187. __data_nosave : {
  188. __nosave_begin = .;
  189. *(.data.nosave)
  190. . = ALIGN(PAGE_SIZE);
  191. __nosave_end = .;
  192. }
  193. /*
  194. * And finally the bss
  195. */
  196. .bss : {
  197. __bss_start = .;
  198. *(.sbss) *(.scommon)
  199. *(.dynbss)
  200. *(.bss)
  201. *(COMMON)
  202. __bss_stop = .;
  203. }
  204. . = ALIGN(PAGE_SIZE);
  205. _end = . ;
  206. PROVIDE32 (end = .);
  207. }