vmlinux.lds.S 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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 <asm/page.h>
  25. #include <asm/cache.h>
  26. #include <asm/processor.h>
  27. #include <asm/thread_info.h>
  28. #define LOAD_OFFSET CONFIG_CACHED_MEMORY_OFFSET
  29. #include <asm-generic/vmlinux.lds.h>
  30. #ifdef NOTDEF
  31. #ifdef CONFIG_LITTLE_ENDIAN
  32. OUTPUT_FORMAT("elf32-sh64l-linux", "elf32-sh64l-linux", "elf32-sh64l-linux")
  33. #else
  34. OUTPUT_FORMAT("elf32-sh64", "elf32-sh64", "elf32-sh64")
  35. #endif
  36. #endif
  37. OUTPUT_ARCH(sh:sh5)
  38. #define C_PHYS(x) AT (ADDR(x) - LOAD_OFFSET)
  39. ENTRY(__start)
  40. SECTIONS
  41. {
  42. . = CONFIG_CACHED_MEMORY_OFFSET + CONFIG_MEMORY_START + PAGE_SIZE;
  43. _text = .; /* Text and read-only data */
  44. text = .; /* Text and read-only data */
  45. .empty_zero_page : C_PHYS(.empty_zero_page) {
  46. *(.empty_zero_page)
  47. } = 0
  48. .text : C_PHYS(.text) {
  49. *(.text)
  50. *(.text64)
  51. *(.text..SHmedia32)
  52. SCHED_TEXT
  53. LOCK_TEXT
  54. *(.fixup)
  55. *(.gnu.warning)
  56. #ifdef CONFIG_LITTLE_ENDIAN
  57. } = 0x6ff0fff0
  58. #else
  59. } = 0xf0fff06f
  60. #endif
  61. /* We likely want __ex_table to be Cache Line aligned */
  62. . = ALIGN(L1_CACHE_BYTES); /* Exception table */
  63. __start___ex_table = .;
  64. __ex_table : C_PHYS(__ex_table) { *(__ex_table) }
  65. __stop___ex_table = .;
  66. RODATA
  67. _etext = .; /* End of text section */
  68. .data : C_PHYS(.data) { /* Data */
  69. *(.data)
  70. CONSTRUCTORS
  71. }
  72. . = ALIGN(PAGE_SIZE);
  73. .data.page_aligned : C_PHYS(.data.page_aligned) { *(.data.page_aligned) }
  74. . = ALIGN(L1_CACHE_BYTES);
  75. __per_cpu_start = .;
  76. .data.percpu : C_PHYS(.data.percpu) { *(.data.percpu) }
  77. __per_cpu_end = . ;
  78. .data.cacheline_aligned : C_PHYS(.data.cacheline_aligned) { *(.data.cacheline_aligned) }
  79. _edata = .; /* End of data section */
  80. . = ALIGN(THREAD_SIZE); /* init_task: structure size aligned */
  81. .data.init_task : C_PHYS(.data.init_task) { *(.data.init_task) }
  82. . = ALIGN(PAGE_SIZE); /* Init code and data */
  83. __init_begin = .;
  84. _sinittext = .;
  85. .init.text : C_PHYS(.init.text) { *(.init.text) }
  86. _einittext = .;
  87. .init.data : C_PHYS(.init.data) { *(.init.data) }
  88. . = ALIGN(L1_CACHE_BYTES); /* Better if Cache Line aligned */
  89. __setup_start = .;
  90. .init.setup : C_PHYS(.init.setup) { *(.init.setup) }
  91. __setup_end = .;
  92. __initcall_start = .;
  93. .initcall.init : C_PHYS(.initcall.init) {
  94. *(.initcall1.init)
  95. *(.initcall2.init)
  96. *(.initcall3.init)
  97. *(.initcall4.init)
  98. *(.initcall5.init)
  99. *(.initcall6.init)
  100. *(.initcall7.init)
  101. }
  102. __initcall_end = .;
  103. __con_initcall_start = .;
  104. .con_initcall.init : C_PHYS(.con_initcall.init) { *(.con_initcall.init) }
  105. __con_initcall_end = .;
  106. SECURITY_INIT
  107. __initramfs_start = .;
  108. .init.ramfs : C_PHYS(.init.ramfs) { *(.init.ramfs) }
  109. __initramfs_end = .;
  110. . = ALIGN(PAGE_SIZE);
  111. __init_end = .;
  112. /* Align to the biggest single data representation, head and tail */
  113. . = ALIGN(8);
  114. __bss_start = .; /* BSS */
  115. .bss : C_PHYS(.bss) {
  116. *(.bss)
  117. }
  118. . = ALIGN(8);
  119. _end = . ;
  120. /* Sections to be discarded */
  121. /DISCARD/ : {
  122. *(.exit.text)
  123. *(.exit.data)
  124. *(.exitcall.exit)
  125. }
  126. /* Stabs debugging sections. */
  127. .stab 0 : C_PHYS(.stab) { *(.stab) }
  128. .stabstr 0 : C_PHYS(.stabstr) { *(.stabstr) }
  129. .stab.excl 0 : C_PHYS(.stab.excl) { *(.stab.excl) }
  130. .stab.exclstr 0 : C_PHYS(.stab.exclstr) { *(.stab.exclstr) }
  131. .stab.index 0 : C_PHYS(.stab.index) { *(.stab.index) }
  132. .stab.indexstr 0 : C_PHYS(.stab.indexstr) { *(.stab.indexstr) }
  133. .comment 0 : C_PHYS(.comment) { *(.comment) }
  134. /* DWARF debug sections.
  135. Symbols in the DWARF debugging section are relative to the beginning
  136. of the section so we begin .debug at 0. */
  137. /* DWARF 1 */
  138. .debug 0 : C_PHYS(.debug) { *(.debug) }
  139. .line 0 : C_PHYS(.line) { *(.line) }
  140. /* GNU DWARF 1 extensions */
  141. .debug_srcinfo 0 : C_PHYS(.debug_srcinfo) { *(.debug_srcinfo) }
  142. .debug_sfnames 0 : C_PHYS(.debug_sfnames) { *(.debug_sfnames) }
  143. /* DWARF 1.1 and DWARF 2 */
  144. .debug_aranges 0 : C_PHYS(.debug_aranges) { *(.debug_aranges) }
  145. .debug_pubnames 0 : C_PHYS(.debug_pubnames) { *(.debug_pubnames) }
  146. /* DWARF 2 */
  147. .debug_info 0 : C_PHYS(.debug_info) { *(.debug_info) }
  148. .debug_abbrev 0 : C_PHYS(.debug_abbrev) { *(.debug_abbrev) }
  149. .debug_line 0 : C_PHYS(.debug_line) { *(.debug_line) }
  150. .debug_frame 0 : C_PHYS(.debug_frame) { *(.debug_frame) }
  151. .debug_str 0 : C_PHYS(.debug_str) { *(.debug_str) }
  152. .debug_loc 0 : C_PHYS(.debug_loc) { *(.debug_loc) }
  153. .debug_macinfo 0 : C_PHYS(.debug_macinfo) { *(.debug_macinfo) }
  154. /* SGI/MIPS DWARF 2 extensions */
  155. .debug_weaknames 0 : C_PHYS(.debug_weaknames) { *(.debug_weaknames) }
  156. .debug_funcnames 0 : C_PHYS(.debug_funcnames) { *(.debug_funcnames) }
  157. .debug_typenames 0 : C_PHYS(.debug_typenames) { *(.debug_typenames) }
  158. .debug_varnames 0 : C_PHYS(.debug_varnames) { *(.debug_varnames) }
  159. /* These must appear regardless of . */
  160. }