vmlinux.lds.S 3.5 KB

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