vmlinux.lds.S 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  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. { *(__special_page_section)
  193. __start_gate_section = .;
  194. *(.data.gate)
  195. __stop_gate_section = .;
  196. #ifdef CONFIG_XEN
  197. . = ALIGN(PAGE_SIZE);
  198. __xen_start_gate_section = .;
  199. *(.data.gate.xen)
  200. __xen_stop_gate_section = .;
  201. #endif
  202. }
  203. . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose
  204. * kernel data
  205. */
  206. .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET)
  207. { *(.data.read_mostly) }
  208. .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET)
  209. { *(.data.cacheline_aligned) }
  210. /* Per-cpu data: */
  211. . = ALIGN(PERCPU_PAGE_SIZE);
  212. PERCPU_VADDR(PERCPU_ADDR, :percpu)
  213. __phys_per_cpu_start = __per_cpu_load;
  214. . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; /* ensure percpu data fits
  215. * into percpu page size
  216. */
  217. data : { } :data
  218. .data : AT(ADDR(.data) - LOAD_OFFSET)
  219. {
  220. #ifdef CONFIG_SMP
  221. . = ALIGN(PERCPU_PAGE_SIZE);
  222. __cpu0_per_cpu = .;
  223. . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */
  224. #endif
  225. DATA_DATA
  226. *(.data1)
  227. *(.gnu.linkonce.d*)
  228. CONSTRUCTORS
  229. }
  230. . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */
  231. .got : AT(ADDR(.got) - LOAD_OFFSET)
  232. { *(.got.plt) *(.got) }
  233. __gp = ADDR(.got) + 0x200000;
  234. /* We want the small data sections together, so single-instruction offsets
  235. can access them all, and initialized data all before uninitialized, so
  236. we can shorten the on-disk segment size. */
  237. .sdata : AT(ADDR(.sdata) - LOAD_OFFSET)
  238. { *(.sdata) *(.sdata1) *(.srdata) }
  239. _edata = .;
  240. __bss_start = .;
  241. .sbss : AT(ADDR(.sbss) - LOAD_OFFSET)
  242. { *(.sbss) *(.scommon) }
  243. .bss : AT(ADDR(.bss) - LOAD_OFFSET)
  244. { *(.bss) *(COMMON) }
  245. __bss_stop = .;
  246. _end = .;
  247. code : { } :code
  248. /* Stabs debugging sections. */
  249. .stab 0 : { *(.stab) }
  250. .stabstr 0 : { *(.stabstr) }
  251. .stab.excl 0 : { *(.stab.excl) }
  252. .stab.exclstr 0 : { *(.stab.exclstr) }
  253. .stab.index 0 : { *(.stab.index) }
  254. .stab.indexstr 0 : { *(.stab.indexstr) }
  255. /* DWARF debug sections.
  256. Symbols in the DWARF debugging sections are relative to the beginning
  257. of the section so we begin them at 0. */
  258. /* DWARF 1 */
  259. .debug 0 : { *(.debug) }
  260. .line 0 : { *(.line) }
  261. /* GNU DWARF 1 extensions */
  262. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  263. .debug_sfnames 0 : { *(.debug_sfnames) }
  264. /* DWARF 1.1 and DWARF 2 */
  265. .debug_aranges 0 : { *(.debug_aranges) }
  266. .debug_pubnames 0 : { *(.debug_pubnames) }
  267. /* DWARF 2 */
  268. .debug_info 0 : { *(.debug_info) }
  269. .debug_abbrev 0 : { *(.debug_abbrev) }
  270. .debug_line 0 : { *(.debug_line) }
  271. .debug_frame 0 : { *(.debug_frame) }
  272. .debug_str 0 : { *(.debug_str) }
  273. .debug_loc 0 : { *(.debug_loc) }
  274. .debug_macinfo 0 : { *(.debug_macinfo) }
  275. /* SGI/MIPS DWARF 2 extensions */
  276. .debug_weaknames 0 : { *(.debug_weaknames) }
  277. .debug_funcnames 0 : { *(.debug_funcnames) }
  278. .debug_typenames 0 : { *(.debug_typenames) }
  279. .debug_varnames 0 : { *(.debug_varnames) }
  280. /* These must appear regardless of . */
  281. /DISCARD/ : { *(.comment) }
  282. /DISCARD/ : { *(.note) }
  283. }