vmlinux.lds.S 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335
  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. _sdata = .;
  101. .data :
  102. {
  103. *(.data)
  104. *(.data1)
  105. *(.sdata)
  106. *(.sdata2)
  107. *(.got.plt) *(.got)
  108. *(.dynamic)
  109. CONSTRUCTORS
  110. }
  111. . = ALIGN(4096);
  112. __nosave_begin = .;
  113. .data_nosave : { *(.data.nosave) }
  114. . = ALIGN(4096);
  115. __nosave_end = .;
  116. . = ALIGN(32);
  117. .data.cacheline_aligned : { *(.data.cacheline_aligned) }
  118. _edata = .;
  119. PROVIDE (edata = .);
  120. . = ALIGN(8192);
  121. .data.init_task : { *(.data.init_task) }
  122. . = ALIGN(4096);
  123. #else
  124. /* will be freed after init */
  125. . = ALIGN(PAGE_SIZE);
  126. #endif
  127. __init_begin = .;
  128. .init.text : {
  129. _sinittext = .;
  130. *(.init.text)
  131. _einittext = .;
  132. }
  133. #ifdef CONFIG_PPC32
  134. /* .exit.text is discarded at runtime, not link time,
  135. to deal with references from __bug_table */
  136. .exit.text : { *(.exit.text) }
  137. #endif
  138. .init.data : {
  139. #ifdef CONFIG_PPC64
  140. *(.init.data)
  141. #else
  142. *(.init.data);
  143. __vtop_table_begin = .;
  144. *(.vtop_fixup);
  145. __vtop_table_end = .;
  146. __ptov_table_begin = .;
  147. *(.ptov_fixup);
  148. __ptov_table_end = .;
  149. #endif
  150. }
  151. . = ALIGN(16);
  152. #ifdef CONFIG_PPC32
  153. __setup_start = .;
  154. #endif
  155. .init.setup : {
  156. #ifdef CONFIG_PPC64
  157. __setup_start = .;
  158. #endif
  159. *(.init.setup)
  160. #ifdef CONFIG_PPC64
  161. __setup_end = .;
  162. #endif
  163. }
  164. #ifdef CONFIG_PPC32
  165. __setup_end = .;
  166. __initcall_start = .;
  167. #endif
  168. .initcall.init : {
  169. #ifdef CONFIG_PPC64
  170. __initcall_start = .;
  171. #endif
  172. *(.initcall1.init)
  173. *(.initcall2.init)
  174. *(.initcall3.init)
  175. *(.initcall4.init)
  176. *(.initcall5.init)
  177. *(.initcall6.init)
  178. *(.initcall7.init)
  179. #ifdef CONFIG_PPC64
  180. __initcall_end = .;
  181. #endif
  182. }
  183. #ifdef CONFIG_PPC32
  184. __initcall_end = .;
  185. __con_initcall_start = .;
  186. #endif
  187. .con_initcall.init : {
  188. #ifdef CONFIG_PPC64
  189. __con_initcall_start = .;
  190. #endif
  191. *(.con_initcall.init)
  192. #ifdef CONFIG_PPC64
  193. __con_initcall_end = .;
  194. #endif
  195. }
  196. #ifdef CONFIG_PPC32
  197. __con_initcall_end = .;
  198. #endif
  199. SECURITY_INIT
  200. #ifdef CONFIG_PPC32
  201. __start___ftr_fixup = .;
  202. __ftr_fixup : { *(__ftr_fixup) }
  203. __stop___ftr_fixup = .;
  204. #else
  205. . = ALIGN(PAGE_SIZE);
  206. .init.ramfs : {
  207. __initramfs_start = .;
  208. *(.init.ramfs)
  209. __initramfs_end = .;
  210. }
  211. #endif
  212. #ifdef CONFIG_PPC32
  213. . = ALIGN(32);
  214. __per_cpu_start = .;
  215. #endif
  216. .data.percpu : {
  217. #ifdef CONFIG_PPC64
  218. __per_cpu_start = .;
  219. #endif
  220. *(.data.percpu)
  221. #ifdef CONFIG_PPC64
  222. __per_cpu_end = .;
  223. #endif
  224. }
  225. #ifdef CONFIG_PPC32
  226. __per_cpu_end = .;
  227. #endif
  228. #ifdef CONFIG_PPC64
  229. . = ALIGN(PAGE_SIZE);
  230. . = ALIGN(16384);
  231. __init_end = .;
  232. /* freed after init ends here */
  233. /* Read/write sections */
  234. . = ALIGN(PAGE_SIZE);
  235. . = ALIGN(16384);
  236. /* The initial task and kernel stack */
  237. .data.init_task : {
  238. *(.data.init_task)
  239. }
  240. . = ALIGN(PAGE_SIZE);
  241. .data.page_aligned : {
  242. *(.data.page_aligned)
  243. }
  244. .data.cacheline_aligned : {
  245. *(.data.cacheline_aligned)
  246. }
  247. .data : {
  248. *(.data .data.rel* .toc1)
  249. *(.branch_lt)
  250. }
  251. .opd : {
  252. *(.opd)
  253. }
  254. .got : {
  255. __toc_start = .;
  256. *(.got)
  257. *(.toc)
  258. . = ALIGN(PAGE_SIZE);
  259. _edata = .;
  260. }
  261. . = ALIGN(PAGE_SIZE);
  262. #else
  263. . = ALIGN(4096);
  264. __initramfs_start = .;
  265. .init.ramfs : {
  266. *(.init.ramfs)
  267. }
  268. __initramfs_end = .;
  269. . = ALIGN(4096);
  270. __init_end = .;
  271. . = ALIGN(4096);
  272. _sextratext = .;
  273. _eextratext = .;
  274. __bss_start = .;
  275. #endif
  276. .bss : {
  277. #ifdef CONFIG_PPC64
  278. __bss_start = .;
  279. #else
  280. *(.sbss) *(.scommon)
  281. *(.dynbss)
  282. #endif
  283. *(.bss)
  284. #ifdef CONFIG_PPC32
  285. *(COMMON)
  286. #else
  287. __bss_stop = .;
  288. #endif
  289. }
  290. #ifdef CONFIG_PPC32
  291. __bss_stop = .;
  292. #endif
  293. #ifdef CONFIG_PPC64
  294. . = ALIGN(PAGE_SIZE);
  295. #endif
  296. _end = . ;
  297. #ifdef CONFIG_PPC32
  298. PROVIDE (end = .);
  299. #endif
  300. }