vmlinux.lds.S 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. #include <linux/config.h>
  2. #ifdef CONFIG_PPC64
  3. #include <asm/page.h>
  4. #define PROVIDE32(x) PROVIDE(__unused__##x)
  5. #else
  6. #define PAGE_SIZE 4096
  7. #define KERNELBASE CONFIG_KERNEL_START
  8. #define PROVIDE32(x) PROVIDE(x)
  9. #endif
  10. #include <asm-generic/vmlinux.lds.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 .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. __start___bug_table = .;
  57. *(__bug_table)
  58. __stop___bug_table = .;
  59. }
  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. }
  83. . = ALIGN(16);
  84. .init.setup : {
  85. __setup_start = .;
  86. *(.init.setup)
  87. __setup_end = .;
  88. }
  89. .initcall.init : {
  90. __initcall_start = .;
  91. *(.initcall1.init)
  92. *(.initcall2.init)
  93. *(.initcall3.init)
  94. *(.initcall4.init)
  95. *(.initcall5.init)
  96. *(.initcall6.init)
  97. *(.initcall7.init)
  98. __initcall_end = .;
  99. }
  100. .con_initcall.init : {
  101. __con_initcall_start = .;
  102. *(.con_initcall.init)
  103. __con_initcall_end = .;
  104. }
  105. SECURITY_INIT
  106. . = ALIGN(8);
  107. __ftr_fixup : {
  108. __start___ftr_fixup = .;
  109. *(__ftr_fixup)
  110. __stop___ftr_fixup = .;
  111. }
  112. . = ALIGN(PAGE_SIZE);
  113. .init.ramfs : {
  114. __initramfs_start = .;
  115. *(.init.ramfs)
  116. __initramfs_end = .;
  117. }
  118. #ifdef CONFIG_PPC32
  119. . = ALIGN(32);
  120. #else
  121. . = ALIGN(128);
  122. #endif
  123. .data.percpu : {
  124. __per_cpu_start = .;
  125. *(.data.percpu)
  126. __per_cpu_end = .;
  127. }
  128. . = ALIGN(8);
  129. .machine.desc : {
  130. __machine_desc_start = . ;
  131. *(.machine.desc)
  132. __machine_desc_end = . ;
  133. }
  134. /* freed after init ends here */
  135. . = ALIGN(PAGE_SIZE);
  136. __init_end = .;
  137. /*
  138. * And now the various read/write data
  139. */
  140. . = ALIGN(PAGE_SIZE);
  141. _sdata = .;
  142. #ifdef CONFIG_PPC32
  143. .data :
  144. {
  145. *(.data)
  146. *(.sdata)
  147. *(.got.plt) *(.got)
  148. }
  149. #else
  150. .data : {
  151. *(.data .data.rel* .toc1)
  152. *(.branch_lt)
  153. }
  154. .opd : {
  155. *(.opd)
  156. }
  157. .got : {
  158. __toc_start = .;
  159. *(.got)
  160. *(.toc)
  161. }
  162. #endif
  163. . = ALIGN(PAGE_SIZE);
  164. _edata = .;
  165. PROVIDE32 (edata = .);
  166. /* The initial task and kernel stack */
  167. #ifdef CONFIG_PPC32
  168. . = ALIGN(8192);
  169. #else
  170. . = ALIGN(16384);
  171. #endif
  172. .data.init_task : {
  173. *(.data.init_task)
  174. }
  175. . = ALIGN(PAGE_SIZE);
  176. .data.page_aligned : {
  177. *(.data.page_aligned)
  178. }
  179. .data.cacheline_aligned : {
  180. *(.data.cacheline_aligned)
  181. }
  182. . = ALIGN(PAGE_SIZE);
  183. __data_nosave : {
  184. __nosave_begin = .;
  185. *(.data.nosave)
  186. . = ALIGN(PAGE_SIZE);
  187. __nosave_end = .;
  188. }
  189. /*
  190. * And finally the bss
  191. */
  192. .bss : {
  193. __bss_start = .;
  194. *(.sbss) *(.scommon)
  195. *(.dynbss)
  196. *(.bss)
  197. *(COMMON)
  198. __bss_stop = .;
  199. }
  200. . = ALIGN(PAGE_SIZE);
  201. _end = . ;
  202. PROVIDE32 (end = .);
  203. }