vmlinux.lds.S 3.5 KB

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