vmlinux.lds.S 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* ld script for sparc32/sparc64 kernel */
  3. #include <asm-generic/vmlinux.lds.h>
  4. #include <asm/page.h>
  5. #include <asm/thread_info.h>
  6. #ifdef CONFIG_SPARC32
  7. #define INITIAL_ADDRESS 0x10000 + SIZEOF_HEADERS
  8. #define TEXTSTART 0xf0004000
  9. #define SMP_CACHE_BYTES_SHIFT 5
  10. #else
  11. #define SMP_CACHE_BYTES_SHIFT 6
  12. #define INITIAL_ADDRESS 0x4000
  13. #define TEXTSTART 0x0000000000404000
  14. #endif
  15. #define SMP_CACHE_BYTES (1 << SMP_CACHE_BYTES_SHIFT)
  16. #ifdef CONFIG_SPARC32
  17. OUTPUT_FORMAT("elf32-sparc", "elf32-sparc", "elf32-sparc")
  18. OUTPUT_ARCH(sparc)
  19. ENTRY(_start)
  20. jiffies = jiffies_64 + 4;
  21. #else
  22. /* sparc64 */
  23. OUTPUT_FORMAT("elf64-sparc", "elf64-sparc", "elf64-sparc")
  24. OUTPUT_ARCH(sparc:v9a)
  25. ENTRY(_start)
  26. jiffies = jiffies_64;
  27. #endif
  28. #ifdef CONFIG_SPARC64
  29. ASSERT((swapper_tsb == 0x0000000000408000), "Error: sparc64 early assembler too large")
  30. #endif
  31. SECTIONS
  32. {
  33. #ifdef CONFIG_SPARC64
  34. swapper_pg_dir = 0x0000000000402000;
  35. #endif
  36. . = INITIAL_ADDRESS;
  37. .text TEXTSTART :
  38. {
  39. _text = .;
  40. HEAD_TEXT
  41. TEXT_TEXT
  42. SCHED_TEXT
  43. CPUIDLE_TEXT
  44. LOCK_TEXT
  45. KPROBES_TEXT
  46. IRQENTRY_TEXT
  47. SOFTIRQENTRY_TEXT
  48. *(.gnu.warning)
  49. } = 0
  50. _etext = .;
  51. RO_DATA(PAGE_SIZE)
  52. /* Start of data section */
  53. _sdata = .;
  54. .data1 : {
  55. *(.data1)
  56. }
  57. RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE)
  58. /* End of data section */
  59. _edata = .;
  60. .fixup : {
  61. __start___fixup = .;
  62. *(.fixup)
  63. __stop___fixup = .;
  64. }
  65. EXCEPTION_TABLE(16)
  66. NOTES
  67. . = ALIGN(PAGE_SIZE);
  68. __init_begin = ALIGN(PAGE_SIZE);
  69. INIT_TEXT_SECTION(PAGE_SIZE)
  70. __init_text_end = .;
  71. INIT_DATA_SECTION(16)
  72. . = ALIGN(4);
  73. .tsb_ldquad_phys_patch : {
  74. __tsb_ldquad_phys_patch = .;
  75. *(.tsb_ldquad_phys_patch)
  76. __tsb_ldquad_phys_patch_end = .;
  77. }
  78. .tsb_phys_patch : {
  79. __tsb_phys_patch = .;
  80. *(.tsb_phys_patch)
  81. __tsb_phys_patch_end = .;
  82. }
  83. .cpuid_patch : {
  84. __cpuid_patch = .;
  85. *(.cpuid_patch)
  86. __cpuid_patch_end = .;
  87. }
  88. .sun4v_1insn_patch : {
  89. __sun4v_1insn_patch = .;
  90. *(.sun4v_1insn_patch)
  91. __sun4v_1insn_patch_end = .;
  92. }
  93. .sun4v_2insn_patch : {
  94. __sun4v_2insn_patch = .;
  95. *(.sun4v_2insn_patch)
  96. __sun4v_2insn_patch_end = .;
  97. }
  98. .leon_1insn_patch : {
  99. __leon_1insn_patch = .;
  100. *(.leon_1insn_patch)
  101. __leon_1insn_patch_end = .;
  102. }
  103. .swapper_tsb_phys_patch : {
  104. __swapper_tsb_phys_patch = .;
  105. *(.swapper_tsb_phys_patch)
  106. __swapper_tsb_phys_patch_end = .;
  107. }
  108. .swapper_4m_tsb_phys_patch : {
  109. __swapper_4m_tsb_phys_patch = .;
  110. *(.swapper_4m_tsb_phys_patch)
  111. __swapper_4m_tsb_phys_patch_end = .;
  112. }
  113. .popc_3insn_patch : {
  114. __popc_3insn_patch = .;
  115. *(.popc_3insn_patch)
  116. __popc_3insn_patch_end = .;
  117. }
  118. .popc_6insn_patch : {
  119. __popc_6insn_patch = .;
  120. *(.popc_6insn_patch)
  121. __popc_6insn_patch_end = .;
  122. }
  123. .pause_3insn_patch : {
  124. __pause_3insn_patch = .;
  125. *(.pause_3insn_patch)
  126. __pause_3insn_patch_end = .;
  127. }
  128. .sun_m7_1insn_patch : {
  129. __sun_m7_1insn_patch = .;
  130. *(.sun_m7_1insn_patch)
  131. __sun_m7_1insn_patch_end = .;
  132. }
  133. .sun_m7_2insn_patch : {
  134. __sun_m7_2insn_patch = .;
  135. *(.sun_m7_2insn_patch)
  136. __sun_m7_2insn_patch_end = .;
  137. }
  138. .get_tick_patch : {
  139. __get_tick_patch = .;
  140. *(.get_tick_patch)
  141. __get_tick_patch_end = .;
  142. }
  143. .pud_huge_patch : {
  144. __pud_huge_patch = .;
  145. *(.pud_huge_patch)
  146. __pud_huge_patch_end = .;
  147. }
  148. .fast_win_ctrl_1insn_patch : {
  149. __fast_win_ctrl_1insn_patch = .;
  150. *(.fast_win_ctrl_1insn_patch)
  151. __fast_win_ctrl_1insn_patch_end = .;
  152. }
  153. PERCPU_SECTION(SMP_CACHE_BYTES)
  154. . = ALIGN(PAGE_SIZE);
  155. .exit.text : {
  156. EXIT_TEXT
  157. }
  158. .exit.data : {
  159. EXIT_DATA
  160. }
  161. . = ALIGN(PAGE_SIZE);
  162. __init_end = .;
  163. BSS_SECTION(0, 0, 0)
  164. _end = . ;
  165. STABS_DEBUG
  166. DWARF_DEBUG
  167. DISCARDS
  168. }