vmlinux.lds.S 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. .data1 : {
  45. *(.data1)
  46. }
  47. RW_DATA_SECTION(SMP_CACHE_BYTES, 0, THREAD_SIZE)
  48. /* End of data section */
  49. _edata = .;
  50. .fixup : {
  51. __start___fixup = .;
  52. *(.fixup)
  53. __stop___fixup = .;
  54. }
  55. EXCEPTION_TABLE(16)
  56. NOTES
  57. . = ALIGN(PAGE_SIZE);
  58. __init_begin = ALIGN(PAGE_SIZE);
  59. INIT_TEXT_SECTION(PAGE_SIZE)
  60. __init_text_end = .;
  61. INIT_DATA_SECTION(16)
  62. . = ALIGN(4);
  63. .tsb_ldquad_phys_patch : {
  64. __tsb_ldquad_phys_patch = .;
  65. *(.tsb_ldquad_phys_patch)
  66. __tsb_ldquad_phys_patch_end = .;
  67. }
  68. .tsb_phys_patch : {
  69. __tsb_phys_patch = .;
  70. *(.tsb_phys_patch)
  71. __tsb_phys_patch_end = .;
  72. }
  73. .cpuid_patch : {
  74. __cpuid_patch = .;
  75. *(.cpuid_patch)
  76. __cpuid_patch_end = .;
  77. }
  78. .sun4v_1insn_patch : {
  79. __sun4v_1insn_patch = .;
  80. *(.sun4v_1insn_patch)
  81. __sun4v_1insn_patch_end = .;
  82. }
  83. .sun4v_2insn_patch : {
  84. __sun4v_2insn_patch = .;
  85. *(.sun4v_2insn_patch)
  86. __sun4v_2insn_patch_end = .;
  87. }
  88. PERCPU(PAGE_SIZE)
  89. . = ALIGN(PAGE_SIZE);
  90. __init_end = .;
  91. BSS_SECTION(0, 0, 0)
  92. _end = . ;
  93. STABS_DEBUG
  94. DWARF_DEBUG
  95. DISCARDS
  96. }