vmlinux.lds.S 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. #include <asm/cache.h>
  11. ENTRY(_stext)
  12. #ifdef CONFIG_PPC64
  13. OUTPUT_ARCH(powerpc:common64)
  14. jiffies = jiffies_64;
  15. #else
  16. OUTPUT_ARCH(powerpc:common)
  17. jiffies = jiffies_64 + 4;
  18. #endif
  19. SECTIONS
  20. {
  21. /* Sections to be discarded. */
  22. /DISCARD/ : {
  23. *(.exitcall.exit)
  24. EXIT_DATA
  25. }
  26. . = KERNELBASE;
  27. /*
  28. * Text, read only data and other permanent read-only sections
  29. */
  30. /* Text and gots */
  31. .text : {
  32. ALIGN_FUNCTION();
  33. *(.text.head)
  34. _text = .;
  35. *(.text .fixup .text.init.refok .exit.text.refok)
  36. SCHED_TEXT
  37. LOCK_TEXT
  38. KPROBES_TEXT
  39. #ifdef CONFIG_PPC32
  40. *(.got1)
  41. __got2_start = .;
  42. *(.got2)
  43. __got2_end = .;
  44. #endif /* CONFIG_PPC32 */
  45. . = ALIGN(PAGE_SIZE);
  46. _etext = .;
  47. PROVIDE32 (etext = .);
  48. }
  49. /* Read-only data */
  50. RODATA
  51. /* Exception & bug tables */
  52. __ex_table : {
  53. __start___ex_table = .;
  54. *(__ex_table)
  55. __stop___ex_table = .;
  56. }
  57. NOTES
  58. BUG_TABLE
  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 : {
  73. EXIT_TEXT
  74. }
  75. .init.data : {
  76. INIT_DATA
  77. __vtop_table_begin = .;
  78. *(.vtop_fixup);
  79. __vtop_table_end = .;
  80. __ptov_table_begin = .;
  81. *(.ptov_fixup);
  82. __ptov_table_end = .;
  83. #ifdef CONFIG_PPC_ISERIES
  84. __dt_strings_start = .;
  85. *(.dt_strings);
  86. __dt_strings_end = .;
  87. #endif
  88. }
  89. . = ALIGN(16);
  90. .init.setup : {
  91. __setup_start = .;
  92. *(.init.setup)
  93. __setup_end = .;
  94. }
  95. .initcall.init : {
  96. __initcall_start = .;
  97. INITCALLS
  98. __initcall_end = .;
  99. }
  100. .con_initcall.init : {
  101. __con_initcall_start = .;
  102. *(.con_initcall.init)
  103. __con_initcall_end = .;
  104. }
  105. SECURITY_INIT
  106. . = ALIGN(8);
  107. __ftr_fixup : {
  108. __start___ftr_fixup = .;
  109. *(__ftr_fixup)
  110. __stop___ftr_fixup = .;
  111. }
  112. #ifdef CONFIG_PPC64
  113. . = ALIGN(8);
  114. __fw_ftr_fixup : {
  115. __start___fw_ftr_fixup = .;
  116. *(__fw_ftr_fixup)
  117. __stop___fw_ftr_fixup = .;
  118. }
  119. #endif
  120. #ifdef CONFIG_BLK_DEV_INITRD
  121. . = ALIGN(PAGE_SIZE);
  122. .init.ramfs : {
  123. __initramfs_start = .;
  124. *(.init.ramfs)
  125. __initramfs_end = .;
  126. }
  127. #endif
  128. . = ALIGN(PAGE_SIZE);
  129. .data.percpu : {
  130. __per_cpu_start = .;
  131. *(.data.percpu)
  132. *(.data.percpu.shared_aligned)
  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_DATA
  153. *(.sdata)
  154. *(.got.plt) *(.got)
  155. }
  156. #else
  157. .data : {
  158. DATA_DATA
  159. *(.data.rel*)
  160. *(.toc1)
  161. *(.branch_lt)
  162. }
  163. .opd : {
  164. *(.opd)
  165. }
  166. .got : {
  167. __toc_start = .;
  168. *(.got)
  169. *(.toc)
  170. }
  171. #endif
  172. . = ALIGN(PAGE_SIZE);
  173. _edata = .;
  174. PROVIDE32 (edata = .);
  175. /* The initial task and kernel stack */
  176. #ifdef CONFIG_PPC32
  177. . = ALIGN(8192);
  178. #else
  179. . = ALIGN(16384);
  180. #endif
  181. .data.init_task : {
  182. *(.data.init_task)
  183. }
  184. . = ALIGN(PAGE_SIZE);
  185. .data.page_aligned : {
  186. *(.data.page_aligned)
  187. }
  188. .data.cacheline_aligned : {
  189. *(.data.cacheline_aligned)
  190. }
  191. . = ALIGN(L1_CACHE_BYTES);
  192. .data.read_mostly : {
  193. *(.data.read_mostly)
  194. }
  195. . = ALIGN(PAGE_SIZE);
  196. __data_nosave : {
  197. __nosave_begin = .;
  198. *(.data.nosave)
  199. . = ALIGN(PAGE_SIZE);
  200. __nosave_end = .;
  201. }
  202. /*
  203. * And finally the bss
  204. */
  205. .bss : {
  206. __bss_start = .;
  207. *(.sbss) *(.scommon)
  208. *(.dynbss)
  209. *(.bss)
  210. *(COMMON)
  211. __bss_stop = .;
  212. }
  213. . = ALIGN(PAGE_SIZE);
  214. _end = . ;
  215. PROVIDE32 (end = .);
  216. }