vmlinux.lds.S 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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. SECTIONS
  28. {
  29. #ifdef CONFIG_SPARC64
  30. swapper_pg_dir = 0x0000000000402000;
  31. #endif
  32. . = INITIAL_ADDRESS;
  33. .text TEXTSTART :
  34. {
  35. _text = .;
  36. HEAD_TEXT
  37. TEXT_TEXT
  38. SCHED_TEXT
  39. LOCK_TEXT
  40. KPROBES_TEXT
  41. IRQENTRY_TEXT
  42. *(.gnu.warning)
  43. } = 0
  44. _etext = .;
  45. RO_DATA(PAGE_SIZE)
  46. /* Start of data section */
  47. _sdata = .;
  48. .data1 : {
  49. *(.data1)
  50. }
  51. RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE)
  52. /* End of data section */
  53. _edata = .;
  54. .fixup : {
  55. __start___fixup = .;
  56. *(.fixup)
  57. __stop___fixup = .;
  58. }
  59. EXCEPTION_TABLE(16)
  60. NOTES
  61. . = ALIGN(PAGE_SIZE);
  62. __init_begin = ALIGN(PAGE_SIZE);
  63. INIT_TEXT_SECTION(PAGE_SIZE)
  64. __init_text_end = .;
  65. INIT_DATA_SECTION(16)
  66. . = ALIGN(4);
  67. .tsb_ldquad_phys_patch : {
  68. __tsb_ldquad_phys_patch = .;
  69. *(.tsb_ldquad_phys_patch)
  70. __tsb_ldquad_phys_patch_end = .;
  71. }
  72. .tsb_phys_patch : {
  73. __tsb_phys_patch = .;
  74. *(.tsb_phys_patch)
  75. __tsb_phys_patch_end = .;
  76. }
  77. .cpuid_patch : {
  78. __cpuid_patch = .;
  79. *(.cpuid_patch)
  80. __cpuid_patch_end = .;
  81. }
  82. .sun4v_1insn_patch : {
  83. __sun4v_1insn_patch = .;
  84. *(.sun4v_1insn_patch)
  85. __sun4v_1insn_patch_end = .;
  86. }
  87. .sun4v_2insn_patch : {
  88. __sun4v_2insn_patch = .;
  89. *(.sun4v_2insn_patch)
  90. __sun4v_2insn_patch_end = .;
  91. }
  92. .leon_1insn_patch : {
  93. __leon_1insn_patch = .;
  94. *(.leon_1insn_patch)
  95. __leon_1insn_patch_end = .;
  96. }
  97. .swapper_tsb_phys_patch : {
  98. __swapper_tsb_phys_patch = .;
  99. *(.swapper_tsb_phys_patch)
  100. __swapper_tsb_phys_patch_end = .;
  101. }
  102. .swapper_4m_tsb_phys_patch : {
  103. __swapper_4m_tsb_phys_patch = .;
  104. *(.swapper_4m_tsb_phys_patch)
  105. __swapper_4m_tsb_phys_patch_end = .;
  106. }
  107. .popc_3insn_patch : {
  108. __popc_3insn_patch = .;
  109. *(.popc_3insn_patch)
  110. __popc_3insn_patch_end = .;
  111. }
  112. .popc_6insn_patch : {
  113. __popc_6insn_patch = .;
  114. *(.popc_6insn_patch)
  115. __popc_6insn_patch_end = .;
  116. }
  117. .pause_3insn_patch : {
  118. __pause_3insn_patch = .;
  119. *(.pause_3insn_patch)
  120. __pause_3insn_patch_end = .;
  121. }
  122. .sun_m7_2insn_patch : {
  123. __sun_m7_2insn_patch = .;
  124. *(.sun_m7_2insn_patch)
  125. __sun_m7_2insn_patch_end = .;
  126. }
  127. PERCPU_SECTION(SMP_CACHE_BYTES)
  128. . = ALIGN(PAGE_SIZE);
  129. __init_end = .;
  130. BSS_SECTION(0, 0, 0)
  131. _end = . ;
  132. STABS_DEBUG
  133. DWARF_DEBUG
  134. DISCARDS
  135. }