vmlinux.lds.S 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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. BUG_TABLE
  57. /*
  58. * Init sections discarded at runtime
  59. */
  60. . = ALIGN(PAGE_SIZE);
  61. __init_begin = .;
  62. .init.text : {
  63. _sinittext = .;
  64. *(.init.text)
  65. _einittext = .;
  66. }
  67. /* .exit.text is discarded at runtime, not link time,
  68. * to deal with references from __bug_table
  69. */
  70. .exit.text : { *(.exit.text) }
  71. .init.data : {
  72. *(.init.data);
  73. __vtop_table_begin = .;
  74. *(.vtop_fixup);
  75. __vtop_table_end = .;
  76. __ptov_table_begin = .;
  77. *(.ptov_fixup);
  78. __ptov_table_end = .;
  79. #ifdef CONFIG_PPC_ISERIES
  80. __dt_strings_start = .;
  81. *(.dt_strings);
  82. __dt_strings_end = .;
  83. #endif
  84. }
  85. . = ALIGN(16);
  86. .init.setup : {
  87. __setup_start = .;
  88. *(.init.setup)
  89. __setup_end = .;
  90. }
  91. .initcall.init : {
  92. __initcall_start = .;
  93. INITCALLS
  94. __initcall_end = .;
  95. }
  96. .con_initcall.init : {
  97. __con_initcall_start = .;
  98. *(.con_initcall.init)
  99. __con_initcall_end = .;
  100. }
  101. SECURITY_INIT
  102. . = ALIGN(8);
  103. __ftr_fixup : {
  104. __start___ftr_fixup = .;
  105. *(__ftr_fixup)
  106. __stop___ftr_fixup = .;
  107. }
  108. #ifdef CONFIG_PPC64
  109. . = ALIGN(8);
  110. __fw_ftr_fixup : {
  111. __start___fw_ftr_fixup = .;
  112. *(__fw_ftr_fixup)
  113. __stop___fw_ftr_fixup = .;
  114. }
  115. #endif
  116. #ifdef CONFIG_BLK_DEV_INITRD
  117. . = ALIGN(PAGE_SIZE);
  118. .init.ramfs : {
  119. __initramfs_start = .;
  120. *(.init.ramfs)
  121. __initramfs_end = .;
  122. }
  123. #endif
  124. . = ALIGN(PAGE_SIZE);
  125. .data.percpu : {
  126. __per_cpu_start = .;
  127. *(.data.percpu)
  128. __per_cpu_end = .;
  129. }
  130. . = ALIGN(8);
  131. .machine.desc : {
  132. __machine_desc_start = . ;
  133. *(.machine.desc)
  134. __machine_desc_end = . ;
  135. }
  136. /* freed after init ends here */
  137. . = ALIGN(PAGE_SIZE);
  138. __init_end = .;
  139. /*
  140. * And now the various read/write data
  141. */
  142. . = ALIGN(PAGE_SIZE);
  143. _sdata = .;
  144. #ifdef CONFIG_PPC32
  145. .data :
  146. {
  147. DATA_DATA
  148. *(.sdata)
  149. *(.got.plt) *(.got)
  150. }
  151. #else
  152. .data : {
  153. *(.data .data.rel* .toc1)
  154. *(.branch_lt)
  155. }
  156. .opd : {
  157. *(.opd)
  158. }
  159. .got : {
  160. __toc_start = .;
  161. *(.got)
  162. *(.toc)
  163. }
  164. #endif
  165. . = ALIGN(PAGE_SIZE);
  166. _edata = .;
  167. PROVIDE32 (edata = .);
  168. /* The initial task and kernel stack */
  169. #ifdef CONFIG_PPC32
  170. . = ALIGN(8192);
  171. #else
  172. . = ALIGN(16384);
  173. #endif
  174. .data.init_task : {
  175. *(.data.init_task)
  176. }
  177. . = ALIGN(PAGE_SIZE);
  178. .data.page_aligned : {
  179. *(.data.page_aligned)
  180. }
  181. .data.cacheline_aligned : {
  182. *(.data.cacheline_aligned)
  183. }
  184. . = ALIGN(L1_CACHE_BYTES);
  185. .data.read_mostly : {
  186. *(.data.read_mostly)
  187. }
  188. . = ALIGN(PAGE_SIZE);
  189. __data_nosave : {
  190. __nosave_begin = .;
  191. *(.data.nosave)
  192. . = ALIGN(PAGE_SIZE);
  193. __nosave_end = .;
  194. }
  195. /*
  196. * And finally the bss
  197. */
  198. .bss : {
  199. __bss_start = .;
  200. *(.sbss) *(.scommon)
  201. *(.dynbss)
  202. *(.bss)
  203. *(COMMON)
  204. __bss_stop = .;
  205. }
  206. . = ALIGN(PAGE_SIZE);
  207. _end = . ;
  208. PROVIDE32 (end = .);
  209. }