vmlinux.lds.S 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  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. _text = .;
  33. TEXT_TEXT
  34. SCHED_TEXT
  35. LOCK_TEXT
  36. KPROBES_TEXT
  37. *(.fixup)
  38. #ifdef CONFIG_PPC32
  39. *(.got1)
  40. __got2_start = .;
  41. *(.got2)
  42. __got2_end = .;
  43. #endif /* CONFIG_PPC32 */
  44. . = ALIGN(PAGE_SIZE);
  45. _etext = .;
  46. PROVIDE32 (etext = .);
  47. }
  48. /* Read-only data */
  49. RODATA
  50. /* Exception & bug tables */
  51. __ex_table : {
  52. __start___ex_table = .;
  53. *(__ex_table)
  54. __stop___ex_table = .;
  55. }
  56. NOTES
  57. BUG_TABLE
  58. /*
  59. * Init sections discarded at runtime
  60. */
  61. . = ALIGN(PAGE_SIZE);
  62. __init_begin = .;
  63. .init.text : {
  64. _sinittext = .;
  65. *(.init.text)
  66. _einittext = .;
  67. }
  68. /* .exit.text is discarded at runtime, not link time,
  69. * to deal with references from __bug_table
  70. */
  71. .exit.text : { *(.exit.text) }
  72. .init.data : {
  73. *(.init.data);
  74. __vtop_table_begin = .;
  75. *(.vtop_fixup);
  76. __vtop_table_end = .;
  77. __ptov_table_begin = .;
  78. *(.ptov_fixup);
  79. __ptov_table_end = .;
  80. #ifdef CONFIG_PPC_ISERIES
  81. __dt_strings_start = .;
  82. *(.dt_strings);
  83. __dt_strings_end = .;
  84. #endif
  85. }
  86. . = ALIGN(16);
  87. .init.setup : {
  88. __setup_start = .;
  89. *(.init.setup)
  90. __setup_end = .;
  91. }
  92. .initcall.init : {
  93. __initcall_start = .;
  94. INITCALLS
  95. __initcall_end = .;
  96. }
  97. .con_initcall.init : {
  98. __con_initcall_start = .;
  99. *(.con_initcall.init)
  100. __con_initcall_end = .;
  101. }
  102. SECURITY_INIT
  103. . = ALIGN(8);
  104. __ftr_fixup : {
  105. __start___ftr_fixup = .;
  106. *(__ftr_fixup)
  107. __stop___ftr_fixup = .;
  108. }
  109. #ifdef CONFIG_PPC64
  110. . = ALIGN(8);
  111. __fw_ftr_fixup : {
  112. __start___fw_ftr_fixup = .;
  113. *(__fw_ftr_fixup)
  114. __stop___fw_ftr_fixup = .;
  115. }
  116. #endif
  117. #ifdef CONFIG_BLK_DEV_INITRD
  118. . = ALIGN(PAGE_SIZE);
  119. .init.ramfs : {
  120. __initramfs_start = .;
  121. *(.init.ramfs)
  122. __initramfs_end = .;
  123. }
  124. #endif
  125. . = ALIGN(PAGE_SIZE);
  126. .data.percpu : {
  127. __per_cpu_start = .;
  128. *(.data.percpu)
  129. *(.data.percpu.shared_aligned)
  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_DATA
  150. *(.sdata)
  151. *(.got.plt) *(.got)
  152. }
  153. #else
  154. .data : {
  155. DATA_DATA
  156. *(.data.rel*)
  157. *(.toc1)
  158. *(.branch_lt)
  159. }
  160. .opd : {
  161. *(.opd)
  162. }
  163. .got : {
  164. __toc_start = .;
  165. *(.got)
  166. *(.toc)
  167. }
  168. #endif
  169. . = ALIGN(PAGE_SIZE);
  170. _edata = .;
  171. PROVIDE32 (edata = .);
  172. /* The initial task and kernel stack */
  173. #ifdef CONFIG_PPC32
  174. . = ALIGN(8192);
  175. #else
  176. . = ALIGN(16384);
  177. #endif
  178. .data.init_task : {
  179. *(.data.init_task)
  180. }
  181. . = ALIGN(PAGE_SIZE);
  182. .data.page_aligned : {
  183. *(.data.page_aligned)
  184. }
  185. .data.cacheline_aligned : {
  186. *(.data.cacheline_aligned)
  187. }
  188. . = ALIGN(L1_CACHE_BYTES);
  189. .data.read_mostly : {
  190. *(.data.read_mostly)
  191. }
  192. . = ALIGN(PAGE_SIZE);
  193. __data_nosave : {
  194. __nosave_begin = .;
  195. *(.data.nosave)
  196. . = ALIGN(PAGE_SIZE);
  197. __nosave_end = .;
  198. }
  199. /*
  200. * And finally the bss
  201. */
  202. .bss : {
  203. __bss_start = .;
  204. *(.sbss) *(.scommon)
  205. *(.dynbss)
  206. *(.bss)
  207. *(COMMON)
  208. __bss_stop = .;
  209. }
  210. . = ALIGN(PAGE_SIZE);
  211. _end = . ;
  212. PROVIDE32 (end = .);
  213. }