vmlinux.lds.S 5.7 KB

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