vmlinux.lds.S 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. . = ALIGN(PAGE_SIZE);
  124. .data.percpu : {
  125. __per_cpu_start = .;
  126. *(.data.percpu)
  127. __per_cpu_end = .;
  128. }
  129. . = ALIGN(8);
  130. .machine.desc : {
  131. __machine_desc_start = . ;
  132. *(.machine.desc)
  133. __machine_desc_end = . ;
  134. }
  135. /* freed after init ends here */
  136. . = ALIGN(PAGE_SIZE);
  137. __init_end = .;
  138. /*
  139. * And now the various read/write data
  140. */
  141. . = ALIGN(PAGE_SIZE);
  142. _sdata = .;
  143. #ifdef CONFIG_PPC32
  144. .data :
  145. {
  146. *(.data)
  147. *(.sdata)
  148. *(.got.plt) *(.got)
  149. }
  150. #else
  151. .data : {
  152. *(.data .data.rel* .toc1)
  153. *(.branch_lt)
  154. }
  155. .opd : {
  156. *(.opd)
  157. }
  158. .got : {
  159. __toc_start = .;
  160. *(.got)
  161. *(.toc)
  162. }
  163. #endif
  164. . = ALIGN(PAGE_SIZE);
  165. _edata = .;
  166. PROVIDE32 (edata = .);
  167. /* The initial task and kernel stack */
  168. #ifdef CONFIG_PPC32
  169. . = ALIGN(8192);
  170. #else
  171. . = ALIGN(16384);
  172. #endif
  173. .data.init_task : {
  174. *(.data.init_task)
  175. }
  176. . = ALIGN(PAGE_SIZE);
  177. .data.page_aligned : {
  178. *(.data.page_aligned)
  179. }
  180. .data.cacheline_aligned : {
  181. *(.data.cacheline_aligned)
  182. }
  183. . = ALIGN(PAGE_SIZE);
  184. __data_nosave : {
  185. __nosave_begin = .;
  186. *(.data.nosave)
  187. . = ALIGN(PAGE_SIZE);
  188. __nosave_end = .;
  189. }
  190. /*
  191. * And finally the bss
  192. */
  193. .bss : {
  194. __bss_start = .;
  195. *(.sbss) *(.scommon)
  196. *(.dynbss)
  197. *(.bss)
  198. *(COMMON)
  199. __bss_stop = .;
  200. }
  201. . = ALIGN(PAGE_SIZE);
  202. _end = . ;
  203. PROVIDE32 (end = .);
  204. }