vmlinux.lds.S 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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 : { *(.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. INITCALLS
  96. __initcall_end = .;
  97. }
  98. .con_initcall.init : {
  99. __con_initcall_start = .;
  100. *(.con_initcall.init)
  101. __con_initcall_end = .;
  102. }
  103. SECURITY_INIT
  104. . = ALIGN(8);
  105. __ftr_fixup : {
  106. __start___ftr_fixup = .;
  107. *(__ftr_fixup)
  108. __stop___ftr_fixup = .;
  109. }
  110. #ifdef CONFIG_PPC64
  111. . = ALIGN(8);
  112. __fw_ftr_fixup : {
  113. __start___fw_ftr_fixup = .;
  114. *(__fw_ftr_fixup)
  115. __stop___fw_ftr_fixup = .;
  116. }
  117. #endif
  118. #ifdef CONFIG_BLK_DEV_INITRD
  119. . = ALIGN(PAGE_SIZE);
  120. .init.ramfs : {
  121. __initramfs_start = .;
  122. *(.init.ramfs)
  123. __initramfs_end = .;
  124. }
  125. #endif
  126. . = ALIGN(PAGE_SIZE);
  127. .data.percpu : {
  128. __per_cpu_start = .;
  129. *(.data.percpu)
  130. *(.data.percpu.shared_aligned)
  131. __per_cpu_end = .;
  132. }
  133. . = ALIGN(8);
  134. .machine.desc : {
  135. __machine_desc_start = . ;
  136. *(.machine.desc)
  137. __machine_desc_end = . ;
  138. }
  139. /* freed after init ends here */
  140. . = ALIGN(PAGE_SIZE);
  141. __init_end = .;
  142. /*
  143. * And now the various read/write data
  144. */
  145. . = ALIGN(PAGE_SIZE);
  146. _sdata = .;
  147. #ifdef CONFIG_PPC32
  148. .data :
  149. {
  150. DATA_DATA
  151. *(.sdata)
  152. *(.got.plt) *(.got)
  153. }
  154. #else
  155. .data : {
  156. DATA_DATA
  157. *(.data.rel*)
  158. *(.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(L1_CACHE_BYTES);
  190. .data.read_mostly : {
  191. *(.data.read_mostly)
  192. }
  193. . = ALIGN(PAGE_SIZE);
  194. __data_nosave : {
  195. __nosave_begin = .;
  196. *(.data.nosave)
  197. . = ALIGN(PAGE_SIZE);
  198. __nosave_end = .;
  199. }
  200. /*
  201. * And finally the bss
  202. */
  203. .bss : {
  204. __bss_start = .;
  205. *(.sbss) *(.scommon)
  206. *(.dynbss)
  207. *(.bss)
  208. *(COMMON)
  209. __bss_stop = .;
  210. }
  211. . = ALIGN(PAGE_SIZE);
  212. _end = . ;
  213. PROVIDE32 (end = .);
  214. }