vmlinux_64.lds.S 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. * ld script to make SH64 Linux kernel
  3. *
  4. * Copyright (C) 2000, 2001 Paolo Alberelli
  5. *
  6. * benedict.gaster@superh.com: 2nd May 2002
  7. * Add definition of empty_zero_page to be the first page of kernel image.
  8. *
  9. * benedict.gaster@superh.com: 3rd May 2002
  10. * Added support for ramdisk, removing statically linked romfs at the
  11. * same time.
  12. *
  13. * lethal@linux-sh.org: 9th May 2003
  14. * Kill off GLOBAL_NAME() usage and other CDC-isms.
  15. *
  16. * lethal@linux-sh.org: 19th May 2003
  17. * Remove support for ancient toolchains.
  18. *
  19. * This file is subject to the terms and conditions of the GNU General Public
  20. * License. See the file "COPYING" in the main directory of this archive
  21. * for more details.
  22. */
  23. #include <asm/page.h>
  24. #include <asm/cache.h>
  25. #include <asm/thread_info.h>
  26. #define LOAD_OFFSET CONFIG_PAGE_OFFSET
  27. #include <asm-generic/vmlinux.lds.h>
  28. OUTPUT_ARCH(sh:sh5)
  29. #define C_PHYS(x) AT (ADDR(x) - LOAD_OFFSET)
  30. ENTRY(__start)
  31. SECTIONS
  32. {
  33. . = CONFIG_PAGE_OFFSET + CONFIG_MEMORY_START + PAGE_SIZE;
  34. _text = .; /* Text and read-only data */
  35. .empty_zero_page : C_PHYS(.empty_zero_page) {
  36. *(.empty_zero_page)
  37. } = 0
  38. .text : C_PHYS(.text) {
  39. *(.text.head)
  40. TEXT_TEXT
  41. *(.text64)
  42. *(.text..SHmedia32)
  43. SCHED_TEXT
  44. LOCK_TEXT
  45. KPROBES_TEXT
  46. *(.fixup)
  47. *(.gnu.warning)
  48. #ifdef CONFIG_CPU_LITTLE_ENDIAN
  49. } = 0x6ff0fff0
  50. #else
  51. } = 0xf0fff06f
  52. #endif
  53. /* We likely want __ex_table to be Cache Line aligned */
  54. . = ALIGN(L1_CACHE_BYTES); /* Exception table */
  55. __start___ex_table = .;
  56. __ex_table : C_PHYS(__ex_table) { *(__ex_table) }
  57. __stop___ex_table = .;
  58. _etext = .; /* End of text section */
  59. NOTES
  60. RO_DATA(PAGE_SIZE)
  61. . = ALIGN(THREAD_SIZE);
  62. .data : C_PHYS(.data) { /* Data */
  63. *(.data.init_task)
  64. . = ALIGN(L1_CACHE_BYTES);
  65. *(.data.cacheline_aligned)
  66. . = ALIGN(L1_CACHE_BYTES);
  67. *(.data.read_mostly)
  68. . = ALIGN(PAGE_SIZE);
  69. *(.data.page_aligned)
  70. __nosave_begin = .;
  71. *(.data.nosave)
  72. . = ALIGN(PAGE_SIZE);
  73. __nosave_end = .;
  74. DATA_DATA
  75. CONSTRUCTORS
  76. }
  77. _edata = .; /* End of data section */
  78. . = ALIGN(PAGE_SIZE); /* Init code and data */
  79. __init_begin = .;
  80. _sinittext = .;
  81. .init.text : C_PHYS(.init.text) { INIT_TEXT }
  82. _einittext = .;
  83. .init.data : C_PHYS(.init.data) { INIT_DATA }
  84. . = ALIGN(L1_CACHE_BYTES); /* Better if Cache Line aligned */
  85. __setup_start = .;
  86. .init.setup : C_PHYS(.init.setup) { *(.init.setup) }
  87. __setup_end = .;
  88. __initcall_start = .;
  89. .initcall.init : C_PHYS(.initcall.init) {
  90. INITCALLS
  91. }
  92. __initcall_end = .;
  93. __con_initcall_start = .;
  94. .con_initcall.init : C_PHYS(.con_initcall.init) {
  95. *(.con_initcall.init)
  96. }
  97. __con_initcall_end = .;
  98. SECURITY_INIT
  99. #ifdef CONFIG_BLK_DEV_INITRD
  100. . = ALIGN(PAGE_SIZE);
  101. __initramfs_start = .;
  102. .init.ramfs : C_PHYS(.init.ramfs) { *(.init.ramfs) }
  103. __initramfs_end = .;
  104. #endif
  105. . = ALIGN(8);
  106. __machvec_start = .;
  107. .machvec.init : C_PHYS(.machvec.init) { *(.machvec.init) }
  108. __machvec_end = .;
  109. PERCPU(PAGE_SIZE)
  110. /*
  111. * .exit.text is discarded at runtime, not link time, to deal with
  112. * references from __bug_table
  113. */
  114. .exit.text : C_PHYS(.exit.text) { EXIT_TEXT }
  115. .exit.data : C_PHYS(.exit.data) { EXIT_DATA }
  116. . = ALIGN(PAGE_SIZE);
  117. .bss : C_PHYS(.bss) {
  118. __init_end = .;
  119. __bss_start = .; /* BSS */
  120. *(.bss.page_aligned)
  121. *(.bss)
  122. *(COMMON)
  123. . = ALIGN(4);
  124. _ebss = .; /* uClinux MTD sucks */
  125. _end = . ;
  126. }
  127. /*
  128. * When something in the kernel is NOT compiled as a module, the
  129. * module cleanup code and data are put into these segments. Both
  130. * can then be thrown away, as cleanup code is never called unless
  131. * it's a module.
  132. */
  133. /DISCARD/ : {
  134. *(.exitcall.exit)
  135. }
  136. STABS_DEBUG
  137. DWARF_DEBUG
  138. }