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. .text.head : AT(ADDR(.text.head) - LOAD_OFFSET)
  47. { *(.text.head) }
  48. .text2 : AT(ADDR(.text2) - LOAD_OFFSET)
  49. { *(.text2) }
  50. #ifdef CONFIG_SMP
  51. .text.lock : AT(ADDR(.text.lock) - LOAD_OFFSET)
  52. { *(.text.lock) }
  53. #endif
  54. _etext = .;
  55. /* Read-only data */
  56. NOTES :code :note /* put .notes in text and mark in PT_NOTE */
  57. code_continues : {} :code /* switch back to regular program... */
  58. /* Exception table */
  59. . = ALIGN(16);
  60. __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET)
  61. {
  62. __start___ex_table = .;
  63. *(__ex_table)
  64. __stop___ex_table = .;
  65. }
  66. /* MCA table */
  67. . = ALIGN(16);
  68. __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET)
  69. {
  70. __start___mca_table = .;
  71. *(__mca_table)
  72. __stop___mca_table = .;
  73. }
  74. .data.patch.phys_stack_reg : AT(ADDR(.data.patch.phys_stack_reg) - LOAD_OFFSET)
  75. {
  76. __start___phys_stack_reg_patchlist = .;
  77. *(.data.patch.phys_stack_reg)
  78. __end___phys_stack_reg_patchlist = .;
  79. }
  80. /* Global data */
  81. _data = .;
  82. /* Unwind info & table: */
  83. . = ALIGN(8);
  84. .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET)
  85. { *(.IA_64.unwind_info*) }
  86. .IA_64.unwind : AT(ADDR(.IA_64.unwind) - LOAD_OFFSET)
  87. {
  88. __start_unwind = .;
  89. *(.IA_64.unwind*)
  90. __end_unwind = .;
  91. } :code :unwind
  92. code_continues2 : {} : code
  93. RODATA
  94. .opd : AT(ADDR(.opd) - LOAD_OFFSET)
  95. { *(.opd) }
  96. /* Initialization code and data: */
  97. . = ALIGN(PAGE_SIZE);
  98. __init_begin = .;
  99. .init.text : AT(ADDR(.init.text) - LOAD_OFFSET)
  100. {
  101. _sinittext = .;
  102. INIT_TEXT
  103. _einittext = .;
  104. }
  105. .init.data : AT(ADDR(.init.data) - LOAD_OFFSET)
  106. { INIT_DATA }
  107. #ifdef CONFIG_BLK_DEV_INITRD
  108. .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET)
  109. {
  110. __initramfs_start = .;
  111. *(.init.ramfs)
  112. __initramfs_end = .;
  113. }
  114. #endif
  115. . = ALIGN(16);
  116. .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET)
  117. {
  118. __setup_start = .;
  119. *(.init.setup)
  120. __setup_end = .;
  121. }
  122. .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET)
  123. {
  124. __initcall_start = .;
  125. INITCALLS
  126. __initcall_end = .;
  127. }
  128. .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET)
  129. {
  130. __start___vtop_patchlist = .;
  131. *(.data.patch.vtop)
  132. __end___vtop_patchlist = .;
  133. }
  134. .data.patch.rse : AT(ADDR(.data.patch.rse) - LOAD_OFFSET)
  135. {
  136. __start___rse_patchlist = .;
  137. *(.data.patch.rse)
  138. __end___rse_patchlist = .;
  139. }
  140. .data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
  141. {
  142. __start___mckinley_e9_bundles = .;
  143. *(.data.patch.mckinley_e9)
  144. __end___mckinley_e9_bundles = .;
  145. }
  146. #if defined(CONFIG_PARAVIRT)
  147. . = ALIGN(16);
  148. .paravirt_bundles : AT(ADDR(.paravirt_bundles) - LOAD_OFFSET)
  149. {
  150. __start_paravirt_bundles = .;
  151. *(.paravirt_bundles)
  152. __stop_paravirt_bundles = .;
  153. }
  154. . = ALIGN(16);
  155. .paravirt_insts : AT(ADDR(.paravirt_insts) - LOAD_OFFSET)
  156. {
  157. __start_paravirt_insts = .;
  158. *(.paravirt_insts)
  159. __stop_paravirt_insts = .;
  160. }
  161. . = ALIGN(16);
  162. .paravirt_branches : AT(ADDR(.paravirt_branches) - LOAD_OFFSET)
  163. {
  164. __start_paravirt_branches = .;
  165. *(.paravirt_branches)
  166. __stop_paravirt_branches = .;
  167. }
  168. #endif
  169. #if defined(CONFIG_IA64_GENERIC)
  170. /* Machine Vector */
  171. . = ALIGN(16);
  172. .machvec : AT(ADDR(.machvec) - LOAD_OFFSET)
  173. {
  174. machvec_start = .;
  175. *(.machvec)
  176. machvec_end = .;
  177. }
  178. #endif
  179. . = ALIGN(8);
  180. __con_initcall_start = .;
  181. .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET)
  182. { *(.con_initcall.init) }
  183. __con_initcall_end = .;
  184. __security_initcall_start = .;
  185. .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET)
  186. { *(.security_initcall.init) }
  187. __security_initcall_end = .;
  188. . = ALIGN(PAGE_SIZE);
  189. __init_end = .;
  190. /* The initial task and kernel stack */
  191. .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET)
  192. { *(.data.init_task) }
  193. .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET)
  194. { *(__special_page_section)
  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. }