vmlinux.lds.S 4.9 KB

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