vmlinux.lds.S 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * arch/sh5/vmlinux.lds.S
  7. *
  8. * ld script to make ST50 Linux kernel
  9. *
  10. * Copyright (C) 2000, 2001 Paolo Alberelli
  11. *
  12. * benedict.gaster@superh.com: 2nd May 2002
  13. * Add definition of empty_zero_page to be the first page of kernel image.
  14. *
  15. * benedict.gaster@superh.com: 3rd May 2002
  16. * Added support for ramdisk, removing statically linked romfs at the same time.
  17. *
  18. * lethal@linux-sh.org: 9th May 2003
  19. * Kill off GLOBAL_NAME() usage and other CDC-isms.
  20. *
  21. * lethal@linux-sh.org: 19th May 2003
  22. * Remove support for ancient toolchains.
  23. */
  24. #include <linux/config.h>
  25. #include <asm/page.h>
  26. #include <asm/cache.h>
  27. #include <asm/processor.h>
  28. #include <asm/thread_info.h>
  29. #define LOAD_OFFSET CONFIG_CACHED_MEMORY_OFFSET
  30. #include <asm-generic/vmlinux.lds.h>
  31. #ifdef NOTDEF
  32. #ifdef CONFIG_LITTLE_ENDIAN
  33. OUTPUT_FORMAT("elf32-sh64l-linux", "elf32-sh64l-linux", "elf32-sh64l-linux")
  34. #else
  35. OUTPUT_FORMAT("elf32-sh64", "elf32-sh64", "elf32-sh64")
  36. #endif
  37. #endif
  38. OUTPUT_ARCH(sh:sh5)
  39. #define C_PHYS(x) AT (ADDR(x) - LOAD_OFFSET)
  40. ENTRY(__start)
  41. SECTIONS
  42. {
  43. . = CONFIG_CACHED_MEMORY_OFFSET + CONFIG_MEMORY_START + PAGE_SIZE;
  44. _text = .; /* Text and read-only data */
  45. text = .; /* Text and read-only data */
  46. .empty_zero_page : C_PHYS(.empty_zero_page) {
  47. *(.empty_zero_page)
  48. } = 0
  49. .text : C_PHYS(.text) {
  50. *(.text)
  51. *(.text64)
  52. *(.text..SHmedia32)
  53. SCHED_TEXT
  54. LOCK_TEXT
  55. *(.fixup)
  56. *(.gnu.warning)
  57. #ifdef CONFIG_LITTLE_ENDIAN
  58. } = 0x6ff0fff0
  59. #else
  60. } = 0xf0fff06f
  61. #endif
  62. /* We likely want __ex_table to be Cache Line aligned */
  63. . = ALIGN(L1_CACHE_BYTES); /* Exception table */
  64. __start___ex_table = .;
  65. __ex_table : C_PHYS(__ex_table) { *(__ex_table) }
  66. __stop___ex_table = .;
  67. RODATA
  68. _etext = .; /* End of text section */
  69. .data : C_PHYS(.data) { /* Data */
  70. *(.data)
  71. CONSTRUCTORS
  72. }
  73. . = ALIGN(PAGE_SIZE);
  74. .data.page_aligned : C_PHYS(.data.page_aligned) { *(.data.page_aligned) }
  75. . = ALIGN(L1_CACHE_BYTES);
  76. __per_cpu_start = .;
  77. .data.percpu : C_PHYS(.data.percpu) { *(.data.percpu) }
  78. __per_cpu_end = . ;
  79. .data.cacheline_aligned : C_PHYS(.data.cacheline_aligned) { *(.data.cacheline_aligned) }
  80. _edata = .; /* End of data section */
  81. . = ALIGN(THREAD_SIZE); /* init_task: structure size aligned */
  82. .data.init_task : C_PHYS(.data.init_task) { *(.data.init_task) }
  83. . = ALIGN(PAGE_SIZE); /* Init code and data */
  84. __init_begin = .;
  85. _sinittext = .;
  86. .init.text : C_PHYS(.init.text) { *(.init.text) }
  87. _einittext = .;
  88. .init.data : C_PHYS(.init.data) { *(.init.data) }
  89. . = ALIGN(L1_CACHE_BYTES); /* Better if Cache Line aligned */
  90. __setup_start = .;
  91. .init.setup : C_PHYS(.init.setup) { *(.init.setup) }
  92. __setup_end = .;
  93. __initcall_start = .;
  94. .initcall.init : C_PHYS(.initcall.init) {
  95. *(.initcall1.init)
  96. *(.initcall2.init)
  97. *(.initcall3.init)
  98. *(.initcall4.init)
  99. *(.initcall5.init)
  100. *(.initcall6.init)
  101. *(.initcall7.init)
  102. }
  103. __initcall_end = .;
  104. __con_initcall_start = .;
  105. .con_initcall.init : C_PHYS(.con_initcall.init) { *(.con_initcall.init) }
  106. __con_initcall_end = .;
  107. SECURITY_INIT
  108. __initramfs_start = .;
  109. .init.ramfs : C_PHYS(.init.ramfs) { *(.init.ramfs) }
  110. __initramfs_end = .;
  111. . = ALIGN(PAGE_SIZE);
  112. __init_end = .;
  113. /* Align to the biggest single data representation, head and tail */
  114. . = ALIGN(8);
  115. __bss_start = .; /* BSS */
  116. .bss : C_PHYS(.bss) {
  117. *(.bss)
  118. }
  119. . = ALIGN(8);
  120. _end = . ;
  121. /* Sections to be discarded */
  122. /DISCARD/ : {
  123. *(.exit.text)
  124. *(.exit.data)
  125. *(.exitcall.exit)
  126. }
  127. /* Stabs debugging sections. */
  128. .stab 0 : C_PHYS(.stab) { *(.stab) }
  129. .stabstr 0 : C_PHYS(.stabstr) { *(.stabstr) }
  130. .stab.excl 0 : C_PHYS(.stab.excl) { *(.stab.excl) }
  131. .stab.exclstr 0 : C_PHYS(.stab.exclstr) { *(.stab.exclstr) }
  132. .stab.index 0 : C_PHYS(.stab.index) { *(.stab.index) }
  133. .stab.indexstr 0 : C_PHYS(.stab.indexstr) { *(.stab.indexstr) }
  134. .comment 0 : C_PHYS(.comment) { *(.comment) }
  135. /* DWARF debug sections.
  136. Symbols in the DWARF debugging section are relative to the beginning
  137. of the section so we begin .debug at 0. */
  138. /* DWARF 1 */
  139. .debug 0 : C_PHYS(.debug) { *(.debug) }
  140. .line 0 : C_PHYS(.line) { *(.line) }
  141. /* GNU DWARF 1 extensions */
  142. .debug_srcinfo 0 : C_PHYS(.debug_srcinfo) { *(.debug_srcinfo) }
  143. .debug_sfnames 0 : C_PHYS(.debug_sfnames) { *(.debug_sfnames) }
  144. /* DWARF 1.1 and DWARF 2 */
  145. .debug_aranges 0 : C_PHYS(.debug_aranges) { *(.debug_aranges) }
  146. .debug_pubnames 0 : C_PHYS(.debug_pubnames) { *(.debug_pubnames) }
  147. /* DWARF 2 */
  148. .debug_info 0 : C_PHYS(.debug_info) { *(.debug_info) }
  149. .debug_abbrev 0 : C_PHYS(.debug_abbrev) { *(.debug_abbrev) }
  150. .debug_line 0 : C_PHYS(.debug_line) { *(.debug_line) }
  151. .debug_frame 0 : C_PHYS(.debug_frame) { *(.debug_frame) }
  152. .debug_str 0 : C_PHYS(.debug_str) { *(.debug_str) }
  153. .debug_loc 0 : C_PHYS(.debug_loc) { *(.debug_loc) }
  154. .debug_macinfo 0 : C_PHYS(.debug_macinfo) { *(.debug_macinfo) }
  155. /* SGI/MIPS DWARF 2 extensions */
  156. .debug_weaknames 0 : C_PHYS(.debug_weaknames) { *(.debug_weaknames) }
  157. .debug_funcnames 0 : C_PHYS(.debug_funcnames) { *(.debug_funcnames) }
  158. .debug_typenames 0 : C_PHYS(.debug_typenames) { *(.debug_typenames) }
  159. .debug_varnames 0 : C_PHYS(.debug_varnames) { *(.debug_varnames) }
  160. /* These must appear regardless of . */
  161. }