vmlinux.lds.S 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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. ENTRY(_stext)
  11. #ifdef CONFIG_PPC64
  12. OUTPUT_ARCH(powerpc:common64)
  13. jiffies = jiffies_64;
  14. #else
  15. OUTPUT_ARCH(powerpc:common)
  16. jiffies = jiffies_64 + 4;
  17. #endif
  18. SECTIONS
  19. {
  20. /* Sections to be discarded. */
  21. /DISCARD/ : {
  22. *(.exitcall.exit)
  23. *(.exit.data)
  24. }
  25. . = KERNELBASE;
  26. /*
  27. * Text, read only data and other permanent read-only sections
  28. */
  29. /* Text and gots */
  30. .text : {
  31. *(.text .text.*)
  32. SCHED_TEXT
  33. LOCK_TEXT
  34. KPROBES_TEXT
  35. *(.fixup)
  36. #ifdef CONFIG_PPC32
  37. *(.got1)
  38. __got2_start = .;
  39. *(.got2)
  40. __got2_end = .;
  41. #endif /* CONFIG_PPC32 */
  42. . = ALIGN(PAGE_SIZE);
  43. _etext = .;
  44. PROVIDE32 (etext = .);
  45. }
  46. /* Read-only data */
  47. RODATA
  48. /* Exception & bug tables */
  49. __ex_table : {
  50. __start___ex_table = .;
  51. *(__ex_table)
  52. __stop___ex_table = .;
  53. }
  54. __bug_table : {
  55. __start___bug_table = .;
  56. *(__bug_table)
  57. __stop___bug_table = .;
  58. }
  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. . = ALIGN(PAGE_SIZE);
  119. .init.ramfs : {
  120. __initramfs_start = .;
  121. *(.init.ramfs)
  122. __initramfs_end = .;
  123. }
  124. #ifdef CONFIG_PPC32
  125. . = ALIGN(32);
  126. #else
  127. . = ALIGN(128);
  128. #endif
  129. .data.percpu : {
  130. __per_cpu_start = .;
  131. *(.data.percpu)
  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)
  152. *(.sdata)
  153. *(.got.plt) *(.got)
  154. }
  155. #else
  156. .data : {
  157. *(.data .data.rel* .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(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. }