vmlinux.lds.S 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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 = .;
  32. *(.text .text.*)
  33. SCHED_TEXT
  34. LOCK_TEXT
  35. KPROBES_TEXT
  36. *(.fixup)
  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. __bug_table : {
  56. __start___bug_table = .;
  57. *(__bug_table)
  58. __stop___bug_table = .;
  59. }
  60. /*
  61. * Init sections discarded at runtime
  62. */
  63. . = ALIGN(PAGE_SIZE);
  64. __init_begin = .;
  65. .init.text : {
  66. _sinittext = .;
  67. *(.init.text)
  68. _einittext = .;
  69. }
  70. /* .exit.text is discarded at runtime, not link time,
  71. * to deal with references from __bug_table
  72. */
  73. .exit.text : { *(.exit.text) }
  74. .init.data : {
  75. *(.init.data);
  76. __vtop_table_begin = .;
  77. *(.vtop_fixup);
  78. __vtop_table_end = .;
  79. __ptov_table_begin = .;
  80. *(.ptov_fixup);
  81. __ptov_table_end = .;
  82. #ifdef CONFIG_PPC_ISERIES
  83. __dt_strings_start = .;
  84. *(.dt_strings);
  85. __dt_strings_end = .;
  86. #endif
  87. }
  88. . = ALIGN(16);
  89. .init.setup : {
  90. __setup_start = .;
  91. *(.init.setup)
  92. __setup_end = .;
  93. }
  94. .initcall.init : {
  95. __initcall_start = .;
  96. INITCALLS
  97. __initcall_end = .;
  98. }
  99. .con_initcall.init : {
  100. __con_initcall_start = .;
  101. *(.con_initcall.init)
  102. __con_initcall_end = .;
  103. }
  104. SECURITY_INIT
  105. . = ALIGN(8);
  106. __ftr_fixup : {
  107. __start___ftr_fixup = .;
  108. *(__ftr_fixup)
  109. __stop___ftr_fixup = .;
  110. }
  111. #ifdef CONFIG_PPC64
  112. . = ALIGN(8);
  113. __fw_ftr_fixup : {
  114. __start___fw_ftr_fixup = .;
  115. *(__fw_ftr_fixup)
  116. __stop___fw_ftr_fixup = .;
  117. }
  118. #endif
  119. . = ALIGN(PAGE_SIZE);
  120. .init.ramfs : {
  121. __initramfs_start = .;
  122. *(.init.ramfs)
  123. __initramfs_end = .;
  124. }
  125. #ifdef CONFIG_PPC32
  126. . = ALIGN(32);
  127. #else
  128. . = ALIGN(128);
  129. #endif
  130. .data.percpu : {
  131. __per_cpu_start = .;
  132. *(.data.percpu)
  133. __per_cpu_end = .;
  134. }
  135. . = ALIGN(8);
  136. .machine.desc : {
  137. __machine_desc_start = . ;
  138. *(.machine.desc)
  139. __machine_desc_end = . ;
  140. }
  141. /* freed after init ends here */
  142. . = ALIGN(PAGE_SIZE);
  143. __init_end = .;
  144. /*
  145. * And now the various read/write data
  146. */
  147. . = ALIGN(PAGE_SIZE);
  148. _sdata = .;
  149. #ifdef CONFIG_PPC32
  150. .data :
  151. {
  152. *(.data)
  153. *(.sdata)
  154. *(.got.plt) *(.got)
  155. }
  156. #else
  157. .data : {
  158. *(.data .data.rel* .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(PAGE_SIZE);
  190. __data_nosave : {
  191. __nosave_begin = .;
  192. *(.data.nosave)
  193. . = ALIGN(PAGE_SIZE);
  194. __nosave_end = .;
  195. }
  196. /*
  197. * And finally the bss
  198. */
  199. .bss : {
  200. __bss_start = .;
  201. *(.sbss) *(.scommon)
  202. *(.dynbss)
  203. *(.bss)
  204. *(COMMON)
  205. __bss_stop = .;
  206. }
  207. . = ALIGN(PAGE_SIZE);
  208. _end = . ;
  209. PROVIDE32 (end = .);
  210. }