vmlinux.lds.S 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. #include <asm/cache.h>
  2. #include <asm/ptrace.h>
  3. #include <asm/system.h>
  4. #include <asm/pgtable.h>
  5. #define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE)
  6. #include <asm-generic/vmlinux.lds.h>
  7. #define IVT_TEXT \
  8. VMLINUX_SYMBOL(__start_ivt_text) = .; \
  9. *(.text.ivt) \
  10. VMLINUX_SYMBOL(__end_ivt_text) = .;
  11. OUTPUT_FORMAT("elf64-ia64-little")
  12. OUTPUT_ARCH(ia64)
  13. ENTRY(phys_start)
  14. jiffies = jiffies_64;
  15. PHDRS {
  16. code PT_LOAD;
  17. percpu PT_LOAD;
  18. data PT_LOAD;
  19. note PT_NOTE;
  20. unwind 0x70000001; /* PT_IA_64_UNWIND, but ld doesn't match the name */
  21. }
  22. SECTIONS
  23. {
  24. /* Sections to be discarded */
  25. /DISCARD/ : {
  26. *(.exit.text)
  27. *(.exit.data)
  28. *(.exitcall.exit)
  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.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
  136. {
  137. __start___mckinley_e9_bundles = .;
  138. *(.data.patch.mckinley_e9)
  139. __end___mckinley_e9_bundles = .;
  140. }
  141. #if defined(CONFIG_IA64_GENERIC)
  142. /* Machine Vector */
  143. . = ALIGN(16);
  144. .machvec : AT(ADDR(.machvec) - LOAD_OFFSET)
  145. {
  146. machvec_start = .;
  147. *(.machvec)
  148. machvec_end = .;
  149. }
  150. #endif
  151. . = ALIGN(8);
  152. __con_initcall_start = .;
  153. .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET)
  154. { *(.con_initcall.init) }
  155. __con_initcall_end = .;
  156. __security_initcall_start = .;
  157. .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET)
  158. { *(.security_initcall.init) }
  159. __security_initcall_end = .;
  160. . = ALIGN(PAGE_SIZE);
  161. __init_end = .;
  162. /* The initial task and kernel stack */
  163. .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET)
  164. { *(.data.init_task) }
  165. .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET)
  166. { *(__special_page_section)
  167. __start_gate_section = .;
  168. *(.data.gate)
  169. __stop_gate_section = .;
  170. }
  171. . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose
  172. * kernel data
  173. */
  174. .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET)
  175. { *(.data.read_mostly) }
  176. .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET)
  177. { *(.data.cacheline_aligned) }
  178. /* Per-cpu data: */
  179. percpu : { } :percpu
  180. . = ALIGN(PERCPU_PAGE_SIZE);
  181. __phys_per_cpu_start = .;
  182. .data.percpu PERCPU_ADDR : AT(__phys_per_cpu_start - LOAD_OFFSET)
  183. {
  184. __per_cpu_start = .;
  185. *(.data.percpu)
  186. *(.data.percpu.shared_aligned)
  187. __per_cpu_end = .;
  188. }
  189. . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; /* ensure percpu data fits
  190. * into percpu page size
  191. */
  192. data : { } :data
  193. .data : AT(ADDR(.data) - LOAD_OFFSET)
  194. {
  195. DATA_DATA
  196. *(.data1)
  197. *(.gnu.linkonce.d*)
  198. CONSTRUCTORS
  199. }
  200. . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */
  201. .got : AT(ADDR(.got) - LOAD_OFFSET)
  202. { *(.got.plt) *(.got) }
  203. __gp = ADDR(.got) + 0x200000;
  204. /* We want the small data sections together, so single-instruction offsets
  205. can access them all, and initialized data all before uninitialized, so
  206. we can shorten the on-disk segment size. */
  207. .sdata : AT(ADDR(.sdata) - LOAD_OFFSET)
  208. { *(.sdata) *(.sdata1) *(.srdata) }
  209. _edata = .;
  210. __bss_start = .;
  211. .sbss : AT(ADDR(.sbss) - LOAD_OFFSET)
  212. { *(.sbss) *(.scommon) }
  213. .bss : AT(ADDR(.bss) - LOAD_OFFSET)
  214. { *(.bss) *(COMMON) }
  215. __bss_stop = .;
  216. _end = .;
  217. code : { } :code
  218. /* Stabs debugging sections. */
  219. .stab 0 : { *(.stab) }
  220. .stabstr 0 : { *(.stabstr) }
  221. .stab.excl 0 : { *(.stab.excl) }
  222. .stab.exclstr 0 : { *(.stab.exclstr) }
  223. .stab.index 0 : { *(.stab.index) }
  224. .stab.indexstr 0 : { *(.stab.indexstr) }
  225. /* DWARF debug sections.
  226. Symbols in the DWARF debugging sections are relative to the beginning
  227. of the section so we begin them at 0. */
  228. /* DWARF 1 */
  229. .debug 0 : { *(.debug) }
  230. .line 0 : { *(.line) }
  231. /* GNU DWARF 1 extensions */
  232. .debug_srcinfo 0 : { *(.debug_srcinfo) }
  233. .debug_sfnames 0 : { *(.debug_sfnames) }
  234. /* DWARF 1.1 and DWARF 2 */
  235. .debug_aranges 0 : { *(.debug_aranges) }
  236. .debug_pubnames 0 : { *(.debug_pubnames) }
  237. /* DWARF 2 */
  238. .debug_info 0 : { *(.debug_info) }
  239. .debug_abbrev 0 : { *(.debug_abbrev) }
  240. .debug_line 0 : { *(.debug_line) }
  241. .debug_frame 0 : { *(.debug_frame) }
  242. .debug_str 0 : { *(.debug_str) }
  243. .debug_loc 0 : { *(.debug_loc) }
  244. .debug_macinfo 0 : { *(.debug_macinfo) }
  245. /* SGI/MIPS DWARF 2 extensions */
  246. .debug_weaknames 0 : { *(.debug_weaknames) }
  247. .debug_funcnames 0 : { *(.debug_funcnames) }
  248. .debug_typenames 0 : { *(.debug_typenames) }
  249. .debug_varnames 0 : { *(.debug_varnames) }
  250. /* These must appear regardless of . */
  251. /DISCARD/ : { *(.comment) }
  252. /DISCARD/ : { *(.note) }
  253. }