vmlinux.lds.S 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. /* swapper_low_pmd_dir is sparc64 only */
  30. swapper_low_pmd_dir = 0x0000000000402000;
  31. . = INITIAL_ADDRESS;
  32. .text TEXTSTART :
  33. {
  34. _text = .;
  35. HEAD_TEXT
  36. TEXT_TEXT
  37. SCHED_TEXT
  38. LOCK_TEXT
  39. KPROBES_TEXT
  40. *(.gnu.warning)
  41. } = 0
  42. _etext = .;
  43. RO_DATA(PAGE_SIZE)
  44. .data : {
  45. DATA_DATA
  46. CONSTRUCTORS
  47. }
  48. .data1 : {
  49. *(.data1)
  50. }
  51. . = ALIGN(SMP_CACHE_BYTES);
  52. .data.cacheline_aligned : {
  53. *(.data.cacheline_aligned)
  54. }
  55. . = ALIGN(SMP_CACHE_BYTES);
  56. .data.read_mostly : {
  57. *(.data.read_mostly)
  58. }
  59. /* End of data section */
  60. _edata = .;
  61. /* init_task */
  62. . = ALIGN(THREAD_SIZE);
  63. .data.init_task : {
  64. *(.data.init_task)
  65. }
  66. .fixup : {
  67. __start___fixup = .;
  68. *(.fixup)
  69. __stop___fixup = .;
  70. }
  71. . = ALIGN(16);
  72. __ex_table : {
  73. __start___ex_table = .;
  74. *(__ex_table)
  75. __stop___ex_table = .;
  76. }
  77. NOTES
  78. . = ALIGN(PAGE_SIZE);
  79. .init.text : {
  80. __init_begin = .;
  81. _sinittext = .;
  82. INIT_TEXT
  83. _einittext = .;
  84. }
  85. __init_text_end = .;
  86. .init.data : {
  87. INIT_DATA
  88. }
  89. . = ALIGN(16);
  90. .init.setup : {
  91. __setup_start = .;
  92. *(.init.setup)
  93. __setup_end = .;
  94. }
  95. .initcall.init : {
  96. __initcall_start = .;
  97. INITCALLS
  98. __initcall_end = .;
  99. }
  100. .con_initcall.init : {
  101. __con_initcall_start = .;
  102. *(.con_initcall.init)
  103. __con_initcall_end = .;
  104. }
  105. SECURITY_INIT
  106. . = ALIGN(4);
  107. .tsb_ldquad_phys_patch : {
  108. __tsb_ldquad_phys_patch = .;
  109. *(.tsb_ldquad_phys_patch)
  110. __tsb_ldquad_phys_patch_end = .;
  111. }
  112. .tsb_phys_patch : {
  113. __tsb_phys_patch = .;
  114. *(.tsb_phys_patch)
  115. __tsb_phys_patch_end = .;
  116. }
  117. .cpuid_patch : {
  118. __cpuid_patch = .;
  119. *(.cpuid_patch)
  120. __cpuid_patch_end = .;
  121. }
  122. .sun4v_1insn_patch : {
  123. __sun4v_1insn_patch = .;
  124. *(.sun4v_1insn_patch)
  125. __sun4v_1insn_patch_end = .;
  126. }
  127. .sun4v_2insn_patch : {
  128. __sun4v_2insn_patch = .;
  129. *(.sun4v_2insn_patch)
  130. __sun4v_2insn_patch_end = .;
  131. }
  132. #ifdef CONFIG_BLK_DEV_INITRD
  133. . = ALIGN(PAGE_SIZE);
  134. .init.ramfs : {
  135. __initramfs_start = .;
  136. *(.init.ramfs)
  137. __initramfs_end = .;
  138. }
  139. #endif
  140. PERCPU(PAGE_SIZE)
  141. . = ALIGN(PAGE_SIZE);
  142. __init_end = .;
  143. __bss_start = .;
  144. .sbss : {
  145. *(.sbss)
  146. *(.scommon)
  147. }
  148. .bss : {
  149. *(.dynbss)
  150. *(.bss)
  151. *(COMMON)
  152. }
  153. _end = . ;
  154. /DISCARD/ : {
  155. EXIT_TEXT
  156. EXIT_DATA
  157. *(.exitcall.exit)
  158. }
  159. STABS_DEBUG
  160. DWARF_DEBUG
  161. }