vmlinux_32.lds.S 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * ld script to make SuperH Linux kernel
  3. * Written by Niibe Yutaka
  4. */
  5. #include <asm/thread_info.h>
  6. #include <asm/cache.h>
  7. #include <asm-generic/vmlinux.lds.h>
  8. #ifdef CONFIG_CPU_LITTLE_ENDIAN
  9. OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
  10. #else
  11. OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
  12. #endif
  13. OUTPUT_ARCH(sh)
  14. ENTRY(_start)
  15. SECTIONS
  16. {
  17. #ifdef CONFIG_PMB_FIXED
  18. . = CONFIG_PAGE_OFFSET + (CONFIG_MEMORY_START & 0x1fffffff) +
  19. CONFIG_ZERO_PAGE_OFFSET;
  20. #elif defined(CONFIG_32BIT)
  21. . = CONFIG_PAGE_OFFSET + CONFIG_ZERO_PAGE_OFFSET;
  22. #else
  23. . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + CONFIG_ZERO_PAGE_OFFSET;
  24. #endif
  25. _text = .; /* Text and read-only data */
  26. .empty_zero_page : {
  27. *(.empty_zero_page)
  28. } = 0
  29. .text : {
  30. HEAD_TEXT
  31. TEXT_TEXT
  32. SCHED_TEXT
  33. LOCK_TEXT
  34. KPROBES_TEXT
  35. *(.fixup)
  36. *(.gnu.warning)
  37. } = 0x0009
  38. . = ALIGN(16); /* Exception table */
  39. __start___ex_table = .;
  40. __ex_table : { *(__ex_table) }
  41. __stop___ex_table = .;
  42. _etext = .; /* End of text section */
  43. NOTES
  44. RO_DATA(PAGE_SIZE)
  45. /*
  46. * Code which must be executed uncached and the associated data
  47. */
  48. . = ALIGN(PAGE_SIZE);
  49. __uncached_start = .;
  50. .uncached.text : { *(.uncached.text) }
  51. .uncached.data : { *(.uncached.data) }
  52. __uncached_end = .;
  53. . = ALIGN(THREAD_SIZE);
  54. .data : { /* Data */
  55. *(.data.init_task)
  56. . = ALIGN(L1_CACHE_BYTES);
  57. *(.data.cacheline_aligned)
  58. . = ALIGN(L1_CACHE_BYTES);
  59. *(.data.read_mostly)
  60. . = ALIGN(PAGE_SIZE);
  61. *(.data.page_aligned)
  62. __nosave_begin = .;
  63. *(.data.nosave)
  64. . = ALIGN(PAGE_SIZE);
  65. __nosave_end = .;
  66. DATA_DATA
  67. CONSTRUCTORS
  68. }
  69. _edata = .; /* End of data section */
  70. . = ALIGN(PAGE_SIZE); /* Init code and data */
  71. __init_begin = .;
  72. _sinittext = .;
  73. .init.text : { INIT_TEXT }
  74. _einittext = .;
  75. .init.data : { INIT_DATA }
  76. . = ALIGN(16);
  77. __setup_start = .;
  78. .init.setup : { *(.init.setup) }
  79. __setup_end = .;
  80. __initcall_start = .;
  81. .initcall.init : {
  82. INITCALLS
  83. }
  84. __initcall_end = .;
  85. __con_initcall_start = .;
  86. .con_initcall.init : { *(.con_initcall.init) }
  87. __con_initcall_end = .;
  88. SECURITY_INIT
  89. #ifdef CONFIG_BLK_DEV_INITRD
  90. . = ALIGN(PAGE_SIZE);
  91. __initramfs_start = .;
  92. .init.ramfs : { *(.init.ramfs) }
  93. __initramfs_end = .;
  94. #endif
  95. . = ALIGN(4);
  96. __machvec_start = .;
  97. .machvec.init : { *(.machvec.init) }
  98. __machvec_end = .;
  99. PERCPU(PAGE_SIZE)
  100. /*
  101. * .exit.text is discarded at runtime, not link time, to deal with
  102. * references from __bug_table
  103. */
  104. .exit.text : { EXIT_TEXT }
  105. .exit.data : { EXIT_DATA }
  106. . = ALIGN(PAGE_SIZE);
  107. .bss : {
  108. __init_end = .;
  109. __bss_start = .; /* BSS */
  110. *(.bss.page_aligned)
  111. *(.bss)
  112. *(COMMON)
  113. . = ALIGN(4);
  114. _ebss = .; /* uClinux MTD sucks */
  115. _end = . ;
  116. }
  117. /*
  118. * When something in the kernel is NOT compiled as a module, the
  119. * module cleanup code and data are put into these segments. Both
  120. * can then be thrown away, as cleanup code is never called unless
  121. * it's a module.
  122. */
  123. /DISCARD/ : {
  124. *(.exitcall.exit)
  125. }
  126. STABS_DEBUG
  127. DWARF_DEBUG
  128. }