vmlinux.lds.S 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. #include <linux/config.h>
  2. #ifdef CONFIG_PPC64
  3. #include <asm/page.h>
  4. #else
  5. #define PAGE_SIZE 4096
  6. #define KERNELBASE CONFIG_KERNEL_START
  7. #endif
  8. #include <asm-generic/vmlinux.lds.h>
  9. ENTRY(_stext)
  10. #ifdef CONFIG_PPC64
  11. OUTPUT_ARCH(powerpc:common64)
  12. jiffies = jiffies_64;
  13. #else
  14. OUTPUT_ARCH(powerpc:common)
  15. jiffies = jiffies_64 + 4;
  16. #endif
  17. SECTIONS
  18. {
  19. /* Sections to be discarded. */
  20. /DISCARD/ : {
  21. *(.exitcall.exit)
  22. *(.exit.data)
  23. }
  24. . = KERNELBASE;
  25. /* Read-only sections, merged into text segment: */
  26. .text : {
  27. *(.text .text.*)
  28. SCHED_TEXT
  29. LOCK_TEXT
  30. KPROBES_TEXT
  31. *(.fixup)
  32. #ifdef CONFIG_PPC32
  33. *(.got1)
  34. __got2_start = .;
  35. *(.got2)
  36. __got2_end = .;
  37. #else
  38. . = ALIGN(PAGE_SIZE);
  39. _etext = .;
  40. #endif
  41. }
  42. #ifdef CONFIG_PPC32
  43. _etext = .;
  44. PROVIDE (etext = .);
  45. RODATA
  46. .fini : { *(.fini) } =0
  47. .ctors : { *(.ctors) }
  48. .dtors : { *(.dtors) }
  49. .fixup : { *(.fixup) }
  50. #endif
  51. __ex_table : {
  52. __start___ex_table = .;
  53. *(__ex_table)
  54. __stop___ex_table = .;
  55. }
  56. __bug_table : {
  57. __start___bug_table = .;
  58. *(__bug_table)
  59. __stop___bug_table = .;
  60. }
  61. #ifdef CONFIG_PPC64
  62. __ftr_fixup : {
  63. __start___ftr_fixup = .;
  64. *(__ftr_fixup)
  65. __stop___ftr_fixup = .;
  66. }
  67. RODATA
  68. #endif
  69. #ifdef CONFIG_PPC32
  70. /* Read-write section, merged into data segment: */
  71. . = ALIGN(PAGE_SIZE);
  72. _sdata = .;
  73. .data :
  74. {
  75. *(.data)
  76. *(.data1)
  77. *(.sdata)
  78. *(.sdata2)
  79. *(.got.plt) *(.got)
  80. *(.dynamic)
  81. CONSTRUCTORS
  82. }
  83. . = ALIGN(PAGE_SIZE);
  84. __nosave_begin = .;
  85. .data_nosave : { *(.data.nosave) }
  86. . = ALIGN(PAGE_SIZE);
  87. __nosave_end = .;
  88. . = ALIGN(32);
  89. .data.cacheline_aligned : { *(.data.cacheline_aligned) }
  90. _edata = .;
  91. PROVIDE (edata = .);
  92. . = ALIGN(8192);
  93. .data.init_task : { *(.data.init_task) }
  94. #endif
  95. /* will be freed after init */
  96. . = ALIGN(PAGE_SIZE);
  97. __init_begin = .;
  98. .init.text : {
  99. _sinittext = .;
  100. *(.init.text)
  101. _einittext = .;
  102. }
  103. #ifdef CONFIG_PPC32
  104. /* .exit.text is discarded at runtime, not link time,
  105. to deal with references from __bug_table */
  106. .exit.text : { *(.exit.text) }
  107. #endif
  108. .init.data : {
  109. *(.init.data);
  110. __vtop_table_begin = .;
  111. *(.vtop_fixup);
  112. __vtop_table_end = .;
  113. __ptov_table_begin = .;
  114. *(.ptov_fixup);
  115. __ptov_table_end = .;
  116. }
  117. . = ALIGN(16);
  118. .init.setup : {
  119. __setup_start = .;
  120. *(.init.setup)
  121. __setup_end = .;
  122. }
  123. .initcall.init : {
  124. __initcall_start = .;
  125. *(.initcall1.init)
  126. *(.initcall2.init)
  127. *(.initcall3.init)
  128. *(.initcall4.init)
  129. *(.initcall5.init)
  130. *(.initcall6.init)
  131. *(.initcall7.init)
  132. __initcall_end = .;
  133. }
  134. .con_initcall.init : {
  135. __con_initcall_start = .;
  136. *(.con_initcall.init)
  137. __con_initcall_end = .;
  138. }
  139. SECURITY_INIT
  140. #ifdef CONFIG_PPC32
  141. __start___ftr_fixup = .;
  142. __ftr_fixup : { *(__ftr_fixup) }
  143. __stop___ftr_fixup = .;
  144. #else
  145. . = ALIGN(PAGE_SIZE);
  146. .init.ramfs : {
  147. __initramfs_start = .;
  148. *(.init.ramfs)
  149. __initramfs_end = .;
  150. }
  151. #endif
  152. #ifdef CONFIG_PPC32
  153. . = ALIGN(32);
  154. #endif
  155. .data.percpu : {
  156. __per_cpu_start = .;
  157. *(.data.percpu)
  158. __per_cpu_end = .;
  159. }
  160. . = ALIGN(PAGE_SIZE);
  161. #ifdef CONFIG_PPC64
  162. . = ALIGN(16384);
  163. __init_end = .;
  164. /* freed after init ends here */
  165. /* Read/write sections */
  166. . = ALIGN(PAGE_SIZE);
  167. . = ALIGN(16384);
  168. _sdata = .;
  169. /* The initial task and kernel stack */
  170. .data.init_task : {
  171. *(.data.init_task)
  172. }
  173. . = ALIGN(PAGE_SIZE);
  174. .data.page_aligned : {
  175. *(.data.page_aligned)
  176. }
  177. .data.cacheline_aligned : {
  178. *(.data.cacheline_aligned)
  179. }
  180. .data : {
  181. *(.data .data.rel* .toc1)
  182. *(.branch_lt)
  183. }
  184. .opd : {
  185. *(.opd)
  186. }
  187. .got : {
  188. __toc_start = .;
  189. *(.got)
  190. *(.toc)
  191. . = ALIGN(PAGE_SIZE);
  192. _edata = .;
  193. }
  194. . = ALIGN(PAGE_SIZE);
  195. #else
  196. __initramfs_start = .;
  197. .init.ramfs : {
  198. *(.init.ramfs)
  199. }
  200. __initramfs_end = .;
  201. . = ALIGN(4096);
  202. __init_end = .;
  203. . = ALIGN(4096);
  204. _sextratext = .;
  205. _eextratext = .;
  206. __bss_start = .;
  207. #endif
  208. .bss : {
  209. __bss_start = .;
  210. *(.sbss) *(.scommon)
  211. *(.dynbss)
  212. *(.bss)
  213. *(COMMON)
  214. __bss_stop = .;
  215. }
  216. #ifdef CONFIG_PPC64
  217. . = ALIGN(PAGE_SIZE);
  218. #endif
  219. _end = . ;
  220. #ifdef CONFIG_PPC32
  221. PROVIDE (end = .);
  222. #endif
  223. }