vmlinux.lds.S 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  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_TEXT
  36. SCHED_TEXT
  37. LOCK_TEXT
  38. KPROBES_TEXT
  39. *(.fixup)
  40. #ifdef CONFIG_PPC32
  41. *(.got1)
  42. __got2_start = .;
  43. *(.got2)
  44. __got2_end = .;
  45. #endif /* CONFIG_PPC32 */
  46. . = ALIGN(PAGE_SIZE);
  47. _etext = .;
  48. PROVIDE32 (etext = .);
  49. }
  50. /* Read-only data */
  51. RODATA
  52. /* Exception & bug tables */
  53. __ex_table : {
  54. __start___ex_table = .;
  55. *(__ex_table)
  56. __stop___ex_table = .;
  57. }
  58. NOTES
  59. BUG_TABLE
  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. #ifdef CONFIG_BLK_DEV_INITRD
  120. . = ALIGN(PAGE_SIZE);
  121. .init.ramfs : {
  122. __initramfs_start = .;
  123. *(.init.ramfs)
  124. __initramfs_end = .;
  125. }
  126. #endif
  127. . = ALIGN(PAGE_SIZE);
  128. .data.percpu : {
  129. __per_cpu_start = .;
  130. *(.data.percpu)
  131. *(.data.percpu.shared_aligned)
  132. __per_cpu_end = .;
  133. }
  134. . = ALIGN(8);
  135. .machine.desc : {
  136. __machine_desc_start = . ;
  137. *(.machine.desc)
  138. __machine_desc_end = . ;
  139. }
  140. /* freed after init ends here */
  141. . = ALIGN(PAGE_SIZE);
  142. __init_end = .;
  143. /*
  144. * And now the various read/write data
  145. */
  146. . = ALIGN(PAGE_SIZE);
  147. _sdata = .;
  148. #ifdef CONFIG_PPC32
  149. .data :
  150. {
  151. DATA_DATA
  152. *(.sdata)
  153. *(.got.plt) *(.got)
  154. }
  155. #else
  156. .data : {
  157. DATA_DATA
  158. *(.data.rel*)
  159. *(.toc1)
  160. *(.branch_lt)
  161. }
  162. .opd : {
  163. *(.opd)
  164. }
  165. .got : {
  166. __toc_start = .;
  167. *(.got)
  168. *(.toc)
  169. }
  170. #endif
  171. . = ALIGN(PAGE_SIZE);
  172. _edata = .;
  173. PROVIDE32 (edata = .);
  174. /* The initial task and kernel stack */
  175. #ifdef CONFIG_PPC32
  176. . = ALIGN(8192);
  177. #else
  178. . = ALIGN(16384);
  179. #endif
  180. .data.init_task : {
  181. *(.data.init_task)
  182. }
  183. . = ALIGN(PAGE_SIZE);
  184. .data.page_aligned : {
  185. *(.data.page_aligned)
  186. }
  187. .data.cacheline_aligned : {
  188. *(.data.cacheline_aligned)
  189. }
  190. . = ALIGN(L1_CACHE_BYTES);
  191. .data.read_mostly : {
  192. *(.data.read_mostly)
  193. }
  194. . = ALIGN(PAGE_SIZE);
  195. __data_nosave : {
  196. __nosave_begin = .;
  197. *(.data.nosave)
  198. . = ALIGN(PAGE_SIZE);
  199. __nosave_end = .;
  200. }
  201. /*
  202. * And finally the bss
  203. */
  204. .bss : {
  205. __bss_start = .;
  206. *(.sbss) *(.scommon)
  207. *(.dynbss)
  208. *(.bss)
  209. *(COMMON)
  210. __bss_stop = .;
  211. }
  212. . = ALIGN(PAGE_SIZE);
  213. _end = . ;
  214. PROVIDE32 (end = .);
  215. }