vmlinux_32.lds.S 2.9 KB

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