vmlinux.lds.S 4.9 KB

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