vmlinux.lds.S 2.6 KB

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