vmlinux.lds.S 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  1. #include <asm/cache.h>
  2. #include <asm/ptrace.h>
  3. #include <asm/system.h>
  4. #include <asm/pgtable.h>
  5. #include <asm-generic/vmlinux.lds.h>
  6. #define IVT_TEXT \
  7. VMLINUX_SYMBOL(__start_ivt_text) = .; \
  8. *(.text.ivt) \
  9. VMLINUX_SYMBOL(__end_ivt_text) = .;
  10. OUTPUT_FORMAT("elf64-ia64-little")
  11. OUTPUT_ARCH(ia64)
  12. ENTRY(phys_start)
  13. jiffies = jiffies_64;
  14. PHDRS {
  15. code PT_LOAD;
  16. percpu PT_LOAD;
  17. data PT_LOAD;
  18. note PT_NOTE;
  19. unwind 0x70000001; /* PT_IA_64_UNWIND, but ld doesn't match the name */
  20. }
  21. SECTIONS
  22. {
  23. /* Sections to be discarded */
  24. /DISCARD/ : {
  25. EXIT_TEXT
  26. EXIT_DATA
  27. *(.exitcall.exit)
  28. *(.IA_64.unwind.exit.text)
  29. *(.IA_64.unwind_info.exit.text)
  30. }
  31. v = PAGE_OFFSET; /* this symbol is here to make debugging easier... */
  32. phys_start = _start - LOAD_OFFSET;
  33. code : { } :code
  34. . = KERNEL_START;
  35. _text = .;
  36. _stext = .;
  37. .text : AT(ADDR(.text) - LOAD_OFFSET)
  38. {
  39. IVT_TEXT
  40. TEXT_TEXT
  41. SCHED_TEXT
  42. LOCK_TEXT
  43. KPROBES_TEXT
  44. *(.gnu.linkonce.t*)
  45. }
  46. .text2 : AT(ADDR(.text2) - LOAD_OFFSET)
  47. { *(.text2) }
  48. #ifdef CONFIG_SMP
  49. .text.lock : AT(ADDR(.text.lock) - LOAD_OFFSET)
  50. { *(.text.lock) }
  51. #endif
  52. _etext = .;
  53. /* Read-only data */
  54. NOTES :code :note /* put .notes in text and mark in PT_NOTE */
  55. code_continues : {} :code /* switch back to regular program... */
  56. /* Exception table */
  57. . = ALIGN(16);
  58. __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET)
  59. {
  60. __start___ex_table = .;
  61. *(__ex_table)
  62. __stop___ex_table = .;
  63. }
  64. /* MCA table */
  65. . = ALIGN(16);
  66. __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET)
  67. {
  68. __start___mca_table = .;
  69. *(__mca_table)
  70. __stop___mca_table = .;
  71. }
  72. .data.patch.phys_stack_reg : AT(ADDR(.data.patch.phys_stack_reg) - LOAD_OFFSET)
  73. {
  74. __start___phys_stack_reg_patchlist = .;
  75. *(.data.patch.phys_stack_reg)
  76. __end___phys_stack_reg_patchlist = .;
  77. }
  78. /* Global data */
  79. _data = .;
  80. /* Unwind info & table: */
  81. . = ALIGN(8);
  82. .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET)
  83. { *(.IA_64.unwind_info*) }
  84. .IA_64.unwind : AT(ADDR(.IA_64.unwind) - LOAD_OFFSET)
  85. {
  86. __start_unwind = .;
  87. *(.IA_64.unwind*)
  88. __end_unwind = .;
  89. } :code :unwind
  90. code_continues2 : {} : code
  91. RODATA
  92. .opd : AT(ADDR(.opd) - LOAD_OFFSET)
  93. { *(.opd) }
  94. /* Initialization code and data: */
  95. . = ALIGN(PAGE_SIZE);
  96. __init_begin = .;
  97. .init.text : AT(ADDR(.init.text) - LOAD_OFFSET)
  98. {
  99. _sinittext = .;
  100. INIT_TEXT
  101. _einittext = .;
  102. }
  103. .init.data : AT(ADDR(.init.data) - LOAD_OFFSET)
  104. { INIT_DATA }
  105. #ifdef CONFIG_BLK_DEV_INITRD
  106. .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET)
  107. {
  108. __initramfs_start = .;
  109. *(.init.ramfs)
  110. __initramfs_end = .;
  111. }
  112. #endif
  113. . = ALIGN(16);
  114. .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET)
  115. {
  116. __setup_start = .;
  117. *(.init.setup)
  118. __setup_end = .;
  119. }
  120. .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET)
  121. {
  122. __initcall_start = .;
  123. INITCALLS
  124. __initcall_end = .;
  125. }
  126. .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET)
  127. {
  128. __start___vtop_patchlist = .;
  129. *(.data.patch.vtop)
  130. __end___vtop_patchlist = .;
  131. }
  132. .data.patch.rse : AT(ADDR(.data.patch.rse) - LOAD_OFFSET)
  133. {
  134. __start___rse_patchlist = .;
  135. *(.data.patch.rse)
  136. __end___rse_patchlist = .;
  137. }
  138. .data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
  139. {
  140. __start___mckinley_e9_bundles = .;
  141. *(.data.patch.mckinley_e9)
  142. __end___mckinley_e9_bundles = .;
  143. }
  144. #if defined(CONFIG_PARAVIRT)
  145. . = ALIGN(16);
  146. .paravirt_bundles : AT(ADDR(.paravirt_bundles) - LOAD_OFFSET)
  147. {
  148. __start_paravirt_bundles = .;
  149. *(.paravirt_bundles)
  150. __stop_paravirt_bundles = .;
  151. }
  152. . = ALIGN(16);
  153. .paravirt_insts : AT(ADDR(.paravirt_insts) - LOAD_OFFSET)
  154. {
  155. __start_paravirt_insts = .;
  156. *(.paravirt_insts)
  157. __stop_paravirt_insts = .;
  158. }
  159. . = ALIGN(16);
  160. .paravirt_branches : AT(ADDR(.paravirt_branches) - LOAD_OFFSET)
  161. {
  162. __start_paravirt_branches = .;
  163. *(.paravirt_branches)
  164. __stop_paravirt_branches = .;
  165. }
  166. #endif
  167. #if defined(CONFIG_IA64_GENERIC)
  168. /* Machine Vector */
  169. . = ALIGN(16);
  170. .machvec : AT(ADDR(.machvec) - LOAD_OFFSET)
  171. {
  172. machvec_start = .;
  173. *(.machvec)
  174. machvec_end = .;
  175. }
  176. #endif
  177. . = ALIGN(8);
  178. __con_initcall_start = .;
  179. .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET)
  180. { *(.con_initcall.init) }
  181. __con_initcall_end = .;
  182. __security_initcall_start = .;
  183. .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET)
  184. { *(.security_initcall.init) }
  185. __security_initcall_end = .;
  186. . = ALIGN(PAGE_SIZE);
  187. __init_end = .;
  188. /* The initial task and kernel stack */
  189. .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET)
  190. { *(.data.init_task) }
  191. .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET)
  192. {
  193. PAGE_ALIGNED_DATA(PAGE_SIZE)
  194. . = ALIGN(PAGE_SIZE);
  195. __start_gate_section = .;
  196. *(.data.gate)
  197. __stop_gate_section = .;
  198. #ifdef CONFIG_XEN
  199. . = ALIGN(PAGE_SIZE);
  200. __xen_start_gate_section = .;
  201. *(.data.gate.xen)
  202. __xen_stop_gate_section = .;
  203. #endif
  204. }
  205. . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose
  206. * kernel data
  207. */
  208. .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET)
  209. { *(.data.read_mostly) }
  210. .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET)
  211. { *(.data.cacheline_aligned) }
  212. /* Per-cpu data: */
  213. . = ALIGN(PERCPU_PAGE_SIZE);
  214. PERCPU_VADDR(PERCPU_ADDR, :percpu)
  215. __phys_per_cpu_start = __per_cpu_load;
  216. . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; /* ensure percpu data fits
  217. * into percpu page size
  218. */
  219. data : { } :data
  220. .data : AT(ADDR(.data) - LOAD_OFFSET)
  221. {
  222. #ifdef CONFIG_SMP
  223. . = ALIGN(PERCPU_PAGE_SIZE);
  224. __cpu0_per_cpu = .;
  225. . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */
  226. #endif
  227. DATA_DATA
  228. *(.data1)
  229. *(.gnu.linkonce.d*)
  230. CONSTRUCTORS
  231. }
  232. . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */
  233. .got : AT(ADDR(.got) - LOAD_OFFSET)
  234. { *(.got.plt) *(.got) }
  235. __gp = ADDR(.got) + 0x200000;
  236. /* We want the small data sections together, so single-instruction offsets
  237. can access them all, and initialized data all before uninitialized, so
  238. we can shorten the on-disk segment size. */
  239. .sdata : AT(ADDR(.sdata) - LOAD_OFFSET)
  240. { *(.sdata) *(.sdata1) *(.srdata) }
  241. _edata = .;
  242. __bss_start = .;
  243. .sbss : AT(ADDR(.sbss) - LOAD_OFFSET)
  244. { *(.sbss) *(.scommon) }
  245. .bss : AT(ADDR(.bss) - LOAD_OFFSET)
  246. { *(.bss) *(COMMON) }
  247. __bss_stop = .;
  248. _end = .;
  249. code : { } :code
  250. /* Stabs debugging sections. */
  251. .stab 0 : { *(.stab) }
  252. .stabstr 0 : { *(.stabstr) }
  253. .stab.excl 0 : { *(.stab.excl) }
  254. .stab.exclstr 0 : { *(.stab.exclstr) }
  255. .stab.index 0 : { *(.stab.index) }
  256. .stab.indexstr 0 : { *(.stab.indexstr) }
  257. /* DWARF debug sections.
  258. Symbols in the DWARF debugging sections are relative to the beginning
  259. of the section so we begin them at 0. */
  260. /* DWARF 1 */
  261. .debug 0 : { *(.debug) }
  262. .line 0 : { *(.line) }
  263. /* GNU DWARF 1 extensions */
  264. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  265. .debug_sfnames 0 : { *(.debug_sfnames) }
  266. /* DWARF 1.1 and DWARF 2 */
  267. .debug_aranges 0 : { *(.debug_aranges) }
  268. .debug_pubnames 0 : { *(.debug_pubnames) }
  269. /* DWARF 2 */
  270. .debug_info 0 : { *(.debug_info) }
  271. .debug_abbrev 0 : { *(.debug_abbrev) }
  272. .debug_line 0 : { *(.debug_line) }
  273. .debug_frame 0 : { *(.debug_frame) }
  274. .debug_str 0 : { *(.debug_str) }
  275. .debug_loc 0 : { *(.debug_loc) }
  276. .debug_macinfo 0 : { *(.debug_macinfo) }
  277. /* SGI/MIPS DWARF 2 extensions */
  278. .debug_weaknames 0 : { *(.debug_weaknames) }
  279. .debug_funcnames 0 : { *(.debug_funcnames) }
  280. .debug_typenames 0 : { *(.debug_typenames) }
  281. .debug_varnames 0 : { *(.debug_varnames) }
  282. /* These must appear regardless of . */
  283. /DISCARD/ : { *(.comment) }
  284. /DISCARD/ : { *(.note) }
  285. }