vmlinux.lds.S 3.1 KB

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