vmlinux.lds.S 7.8 KB

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