vmlinux.lds.S 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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. /* unwind exit sections must be discarded before the rest of the
  24. sections get included. */
  25. /DISCARD/ : {
  26. *(.IA_64.unwind.exit.text)
  27. *(.IA_64.unwind_info.exit.text)
  28. *(.comment)
  29. *(.note)
  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(16)
  57. /* MCA table */
  58. . = ALIGN(16);
  59. __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET)
  60. {
  61. __start___mca_table = .;
  62. *(__mca_table)
  63. __stop___mca_table = .;
  64. }
  65. .data.patch.phys_stack_reg : AT(ADDR(.data.patch.phys_stack_reg) - LOAD_OFFSET)
  66. {
  67. __start___phys_stack_reg_patchlist = .;
  68. *(.data.patch.phys_stack_reg)
  69. __end___phys_stack_reg_patchlist = .;
  70. }
  71. /* Global data */
  72. _data = .;
  73. /* Unwind info & table: */
  74. . = ALIGN(8);
  75. .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET)
  76. { *(.IA_64.unwind_info*) }
  77. .IA_64.unwind : AT(ADDR(.IA_64.unwind) - LOAD_OFFSET)
  78. {
  79. __start_unwind = .;
  80. *(.IA_64.unwind*)
  81. __end_unwind = .;
  82. } :code :unwind
  83. code_continues2 : {} : code
  84. RODATA
  85. .opd : AT(ADDR(.opd) - LOAD_OFFSET)
  86. { *(.opd) }
  87. /* Initialization code and data: */
  88. . = ALIGN(PAGE_SIZE);
  89. __init_begin = .;
  90. INIT_TEXT_SECTION(PAGE_SIZE)
  91. INIT_DATA_SECTION(16)
  92. .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET)
  93. {
  94. __start___vtop_patchlist = .;
  95. *(.data.patch.vtop)
  96. __end___vtop_patchlist = .;
  97. }
  98. .data.patch.rse : AT(ADDR(.data.patch.rse) - LOAD_OFFSET)
  99. {
  100. __start___rse_patchlist = .;
  101. *(.data.patch.rse)
  102. __end___rse_patchlist = .;
  103. }
  104. .data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
  105. {
  106. __start___mckinley_e9_bundles = .;
  107. *(.data.patch.mckinley_e9)
  108. __end___mckinley_e9_bundles = .;
  109. }
  110. #if defined(CONFIG_PARAVIRT)
  111. . = ALIGN(16);
  112. .paravirt_bundles : AT(ADDR(.paravirt_bundles) - LOAD_OFFSET)
  113. {
  114. __start_paravirt_bundles = .;
  115. *(.paravirt_bundles)
  116. __stop_paravirt_bundles = .;
  117. }
  118. . = ALIGN(16);
  119. .paravirt_insts : AT(ADDR(.paravirt_insts) - LOAD_OFFSET)
  120. {
  121. __start_paravirt_insts = .;
  122. *(.paravirt_insts)
  123. __stop_paravirt_insts = .;
  124. }
  125. . = ALIGN(16);
  126. .paravirt_branches : AT(ADDR(.paravirt_branches) - LOAD_OFFSET)
  127. {
  128. __start_paravirt_branches = .;
  129. *(.paravirt_branches)
  130. __stop_paravirt_branches = .;
  131. }
  132. #endif
  133. #if defined(CONFIG_IA64_GENERIC)
  134. /* Machine Vector */
  135. . = ALIGN(16);
  136. .machvec : AT(ADDR(.machvec) - LOAD_OFFSET)
  137. {
  138. machvec_start = .;
  139. *(.machvec)
  140. machvec_end = .;
  141. }
  142. #endif
  143. . = ALIGN(PAGE_SIZE);
  144. __init_end = .;
  145. .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET)
  146. {
  147. PAGE_ALIGNED_DATA(PAGE_SIZE)
  148. . = ALIGN(PAGE_SIZE);
  149. __start_gate_section = .;
  150. *(.data.gate)
  151. __stop_gate_section = .;
  152. #ifdef CONFIG_XEN
  153. . = ALIGN(PAGE_SIZE);
  154. __xen_start_gate_section = .;
  155. *(.data.gate.xen)
  156. __xen_stop_gate_section = .;
  157. #endif
  158. }
  159. . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose
  160. * kernel data
  161. */
  162. /* Per-cpu data: */
  163. . = ALIGN(PERCPU_PAGE_SIZE);
  164. PERCPU_VADDR(PERCPU_ADDR, :percpu)
  165. __phys_per_cpu_start = __per_cpu_load;
  166. . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; /* ensure percpu data fits
  167. * into percpu page size
  168. */
  169. data : { } :data
  170. .data : AT(ADDR(.data) - LOAD_OFFSET)
  171. {
  172. #ifdef CONFIG_SMP
  173. . = ALIGN(PERCPU_PAGE_SIZE);
  174. __cpu0_per_cpu = .;
  175. . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */
  176. #endif
  177. INIT_TASK_DATA(PAGE_SIZE)
  178. CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES)
  179. READ_MOSTLY_DATA(SMP_CACHE_BYTES)
  180. DATA_DATA
  181. *(.data1)
  182. *(.gnu.linkonce.d*)
  183. CONSTRUCTORS
  184. }
  185. . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */
  186. .got : AT(ADDR(.got) - LOAD_OFFSET)
  187. { *(.got.plt) *(.got) }
  188. __gp = ADDR(.got) + 0x200000;
  189. /* We want the small data sections together, so single-instruction offsets
  190. can access them all, and initialized data all before uninitialized, so
  191. we can shorten the on-disk segment size. */
  192. .sdata : AT(ADDR(.sdata) - LOAD_OFFSET)
  193. { *(.sdata) *(.sdata1) *(.srdata) }
  194. _edata = .;
  195. BSS_SECTION(0, 0, 0)
  196. _end = .;
  197. code : { } :code
  198. STABS_DEBUG
  199. DWARF_DEBUG
  200. /* Default discards */
  201. DISCARDS
  202. }