vmlinux.lds.S 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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_IA64_GENERIC)
  147. /* Machine Vector */
  148. . = ALIGN(16);
  149. .machvec : AT(ADDR(.machvec) - LOAD_OFFSET)
  150. {
  151. machvec_start = .;
  152. *(.machvec)
  153. machvec_end = .;
  154. }
  155. #endif
  156. . = ALIGN(8);
  157. __con_initcall_start = .;
  158. .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET)
  159. { *(.con_initcall.init) }
  160. __con_initcall_end = .;
  161. __security_initcall_start = .;
  162. .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET)
  163. { *(.security_initcall.init) }
  164. __security_initcall_end = .;
  165. . = ALIGN(PAGE_SIZE);
  166. __init_end = .;
  167. /* The initial task and kernel stack */
  168. .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET)
  169. { *(.data.init_task) }
  170. .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET)
  171. { *(__special_page_section)
  172. __start_gate_section = .;
  173. *(.data.gate)
  174. __stop_gate_section = .;
  175. }
  176. . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose
  177. * kernel data
  178. */
  179. .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET)
  180. { *(.data.read_mostly) }
  181. .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET)
  182. { *(.data.cacheline_aligned) }
  183. /* Per-cpu data: */
  184. percpu : { } :percpu
  185. . = ALIGN(PERCPU_PAGE_SIZE);
  186. __phys_per_cpu_start = .;
  187. .data.percpu PERCPU_ADDR : AT(__phys_per_cpu_start - LOAD_OFFSET)
  188. {
  189. __per_cpu_start = .;
  190. *(.data.percpu)
  191. *(.data.percpu.shared_aligned)
  192. __per_cpu_end = .;
  193. }
  194. . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; /* ensure percpu data fits
  195. * into percpu page size
  196. */
  197. data : { } :data
  198. .data : AT(ADDR(.data) - LOAD_OFFSET)
  199. {
  200. #ifdef CONFIG_SMP
  201. . = ALIGN(PERCPU_PAGE_SIZE);
  202. __cpu0_per_cpu = .;
  203. . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */
  204. #endif
  205. DATA_DATA
  206. *(.data1)
  207. *(.gnu.linkonce.d*)
  208. CONSTRUCTORS
  209. }
  210. . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */
  211. .got : AT(ADDR(.got) - LOAD_OFFSET)
  212. { *(.got.plt) *(.got) }
  213. __gp = ADDR(.got) + 0x200000;
  214. /* We want the small data sections together, so single-instruction offsets
  215. can access them all, and initialized data all before uninitialized, so
  216. we can shorten the on-disk segment size. */
  217. .sdata : AT(ADDR(.sdata) - LOAD_OFFSET)
  218. { *(.sdata) *(.sdata1) *(.srdata) }
  219. _edata = .;
  220. __bss_start = .;
  221. .sbss : AT(ADDR(.sbss) - LOAD_OFFSET)
  222. { *(.sbss) *(.scommon) }
  223. .bss : AT(ADDR(.bss) - LOAD_OFFSET)
  224. { *(.bss) *(COMMON) }
  225. __bss_stop = .;
  226. _end = .;
  227. code : { } :code
  228. /* Stabs debugging sections. */
  229. .stab 0 : { *(.stab) }
  230. .stabstr 0 : { *(.stabstr) }
  231. .stab.excl 0 : { *(.stab.excl) }
  232. .stab.exclstr 0 : { *(.stab.exclstr) }
  233. .stab.index 0 : { *(.stab.index) }
  234. .stab.indexstr 0 : { *(.stab.indexstr) }
  235. /* DWARF debug sections.
  236. Symbols in the DWARF debugging sections are relative to the beginning
  237. of the section so we begin them at 0. */
  238. /* DWARF 1 */
  239. .debug 0 : { *(.debug) }
  240. .line 0 : { *(.line) }
  241. /* GNU DWARF 1 extensions */
  242. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  243. .debug_sfnames 0 : { *(.debug_sfnames) }
  244. /* DWARF 1.1 and DWARF 2 */
  245. .debug_aranges 0 : { *(.debug_aranges) }
  246. .debug_pubnames 0 : { *(.debug_pubnames) }
  247. /* DWARF 2 */
  248. .debug_info 0 : { *(.debug_info) }
  249. .debug_abbrev 0 : { *(.debug_abbrev) }
  250. .debug_line 0 : { *(.debug_line) }
  251. .debug_frame 0 : { *(.debug_frame) }
  252. .debug_str 0 : { *(.debug_str) }
  253. .debug_loc 0 : { *(.debug_loc) }
  254. .debug_macinfo 0 : { *(.debug_macinfo) }
  255. /* SGI/MIPS DWARF 2 extensions */
  256. .debug_weaknames 0 : { *(.debug_weaknames) }
  257. .debug_funcnames 0 : { *(.debug_funcnames) }
  258. .debug_typenames 0 : { *(.debug_typenames) }
  259. .debug_varnames 0 : { *(.debug_varnames) }
  260. /* These must appear regardless of . */
  261. /DISCARD/ : { *(.comment) }
  262. /DISCARD/ : { *(.note) }
  263. }