vmlinux.lds.S 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #include <asm/cache.h>
  3. #include <asm/ptrace.h>
  4. #include <asm/pgtable.h>
  5. #include <asm/thread_info.h>
  6. #include <asm-generic/vmlinux.lds.h>
  7. OUTPUT_FORMAT("elf64-ia64-little")
  8. OUTPUT_ARCH(ia64)
  9. ENTRY(phys_start)
  10. jiffies = jiffies_64;
  11. PHDRS {
  12. code PT_LOAD;
  13. percpu PT_LOAD;
  14. data PT_LOAD;
  15. note PT_NOTE;
  16. unwind 0x70000001; /* PT_IA_64_UNWIND, but ld doesn't match the name */
  17. }
  18. SECTIONS {
  19. /*
  20. * unwind exit sections must be discarded before
  21. * the rest of the sections get included.
  22. */
  23. /DISCARD/ : {
  24. *(.IA_64.unwind.exit.text)
  25. *(.IA_64.unwind_info.exit.text)
  26. *(.comment)
  27. *(.note)
  28. }
  29. v = PAGE_OFFSET; /* this symbol is here to make debugging easier... */
  30. phys_start = _start - LOAD_OFFSET;
  31. code : {
  32. } :code
  33. . = KERNEL_START;
  34. _text = .;
  35. _stext = .;
  36. .text : AT(ADDR(.text) - LOAD_OFFSET) {
  37. __start_ivt_text = .;
  38. *(.text..ivt)
  39. __end_ivt_text = .;
  40. TEXT_TEXT
  41. SCHED_TEXT
  42. CPUIDLE_TEXT
  43. LOCK_TEXT
  44. KPROBES_TEXT
  45. *(.gnu.linkonce.t*)
  46. }
  47. .text2 : AT(ADDR(.text2) - LOAD_OFFSET) {
  48. *(.text2)
  49. }
  50. #ifdef CONFIG_SMP
  51. .text..lock : AT(ADDR(.text..lock) - LOAD_OFFSET) {
  52. *(.text..lock)
  53. }
  54. #endif
  55. _etext = .;
  56. /*
  57. * Read-only data
  58. */
  59. NOTES :code :note /* put .notes in text and mark in PT_NOTE */
  60. code_continues : {
  61. } : code /* switch back to regular program... */
  62. EXCEPTION_TABLE(16)
  63. /* MCA table */
  64. . = ALIGN(16);
  65. __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET) {
  66. __start___mca_table = .;
  67. *(__mca_table)
  68. __stop___mca_table = .;
  69. }
  70. .data..patch.phys_stack_reg : AT(ADDR(.data..patch.phys_stack_reg) - LOAD_OFFSET) {
  71. __start___phys_stack_reg_patchlist = .;
  72. *(.data..patch.phys_stack_reg)
  73. __end___phys_stack_reg_patchlist = .;
  74. }
  75. /*
  76. * Global data
  77. */
  78. _data = .;
  79. /* Unwind info & table: */
  80. . = ALIGN(8);
  81. .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET) {
  82. *(.IA_64.unwind_info*)
  83. }
  84. .IA_64.unwind : AT(ADDR(.IA_64.unwind) - LOAD_OFFSET) {
  85. __start_unwind = .;
  86. *(.IA_64.unwind*)
  87. __end_unwind = .;
  88. } :code :unwind
  89. code_continues2 : {
  90. } : code
  91. RODATA
  92. .opd : AT(ADDR(.opd) - LOAD_OFFSET) {
  93. __start_opd = .;
  94. *(.opd)
  95. __end_opd = .;
  96. }
  97. /*
  98. * Initialization code and data:
  99. */
  100. . = ALIGN(PAGE_SIZE);
  101. __init_begin = .;
  102. INIT_TEXT_SECTION(PAGE_SIZE)
  103. INIT_DATA_SECTION(16)
  104. .data..patch.vtop : AT(ADDR(.data..patch.vtop) - LOAD_OFFSET) {
  105. __start___vtop_patchlist = .;
  106. *(.data..patch.vtop)
  107. __end___vtop_patchlist = .;
  108. }
  109. .data..patch.rse : AT(ADDR(.data..patch.rse) - LOAD_OFFSET) {
  110. __start___rse_patchlist = .;
  111. *(.data..patch.rse)
  112. __end___rse_patchlist = .;
  113. }
  114. .data..patch.mckinley_e9 : AT(ADDR(.data..patch.mckinley_e9) - LOAD_OFFSET) {
  115. __start___mckinley_e9_bundles = .;
  116. *(.data..patch.mckinley_e9)
  117. __end___mckinley_e9_bundles = .;
  118. }
  119. #if defined(CONFIG_IA64_GENERIC)
  120. /* Machine Vector */
  121. . = ALIGN(16);
  122. .machvec : AT(ADDR(.machvec) - LOAD_OFFSET) {
  123. machvec_start = .;
  124. *(.machvec)
  125. machvec_end = .;
  126. }
  127. #endif
  128. #ifdef CONFIG_SMP
  129. . = ALIGN(PERCPU_PAGE_SIZE);
  130. __cpu0_per_cpu = .;
  131. . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */
  132. #endif
  133. . = ALIGN(PAGE_SIZE);
  134. __init_end = .;
  135. .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET) {
  136. PAGE_ALIGNED_DATA(PAGE_SIZE)
  137. . = ALIGN(PAGE_SIZE);
  138. __start_gate_section = .;
  139. *(.data..gate)
  140. __stop_gate_section = .;
  141. }
  142. /*
  143. * make sure the gate page doesn't expose
  144. * kernel data
  145. */
  146. . = ALIGN(PAGE_SIZE);
  147. /* Per-cpu data: */
  148. . = ALIGN(PERCPU_PAGE_SIZE);
  149. PERCPU_VADDR(SMP_CACHE_BYTES, PERCPU_ADDR, :percpu)
  150. __phys_per_cpu_start = __per_cpu_load;
  151. /*
  152. * ensure percpu data fits
  153. * into percpu page size
  154. */
  155. . = __phys_per_cpu_start + PERCPU_PAGE_SIZE;
  156. data : {
  157. } :data
  158. .data : AT(ADDR(.data) - LOAD_OFFSET) {
  159. _sdata = .;
  160. INIT_TASK_DATA(PAGE_SIZE)
  161. CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES)
  162. READ_MOSTLY_DATA(SMP_CACHE_BYTES)
  163. DATA_DATA
  164. *(.data1)
  165. *(.gnu.linkonce.d*)
  166. CONSTRUCTORS
  167. }
  168. BUG_TABLE
  169. . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */
  170. .got : AT(ADDR(.got) - LOAD_OFFSET) {
  171. *(.got.plt)
  172. *(.got)
  173. }
  174. __gp = ADDR(.got) + 0x200000;
  175. /*
  176. * We want the small data sections together,
  177. * so single-instruction offsets can access
  178. * them all, and initialized data all before
  179. * uninitialized, so we can shorten the
  180. * on-disk segment size.
  181. */
  182. .sdata : AT(ADDR(.sdata) - LOAD_OFFSET) {
  183. *(.sdata)
  184. *(.sdata1)
  185. *(.srdata)
  186. }
  187. _edata = .;
  188. BSS_SECTION(0, 0, 0)
  189. _end = .;
  190. code : {
  191. } :code
  192. STABS_DEBUG
  193. DWARF_DEBUG
  194. /* Default discards */
  195. DISCARDS
  196. }