vmlinux.lds.S 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. /*
  2. * arch/v850/vmlinux.lds.S -- kernel linker script for v850 platforms
  3. *
  4. * Copyright (C) 2002,03,04,05 NEC Electronics Corporation
  5. * Copyright (C) 2002,03,04,05 Miles Bader <miles@gnu.org>
  6. *
  7. * This file is subject to the terms and conditions of the GNU General
  8. * Public License. See the file COPYING in the main directory of this
  9. * archive for more details.
  10. *
  11. * Written by Miles Bader <miles@gnu.org>
  12. */
  13. #define VMLINUX_SYMBOL(_sym_) _##_sym_
  14. #include <asm-generic/vmlinux.lds.h>
  15. /* For most platforms, this will define useful things like RAM addr/size. */
  16. #include <asm/machdep.h>
  17. /* The following macros contain the usual definitions for various data areas.
  18. The prefix `RAMK_' is used to indicate macros suitable for kernels loaded
  19. into RAM, and similarly `ROMK_' for ROM-resident kernels. Note that all
  20. symbols are prefixed with an extra `_' for compatibility with the v850
  21. toolchain. */
  22. /* Interrupt vectors. */
  23. #define INTV_CONTENTS \
  24. . = ALIGN (0x10) ; \
  25. __intv_start = . ; \
  26. *(.intv.reset) /* Reset vector */ \
  27. . = __intv_start + 0x10 ; \
  28. *(.intv.common) /* Vectors common to all v850e proc */\
  29. . = __intv_start + 0x80 ; \
  30. *(.intv.mach) /* Machine-specific int. vectors. */ \
  31. __intv_end = . ;
  32. #define RODATA_CONTENTS \
  33. . = ALIGN (16) ; \
  34. *(.rodata) *(.rodata.*) \
  35. *(__vermagic) /* Kernel version magic */ \
  36. *(.rodata1) \
  37. /* PCI quirks */ \
  38. ___start_pci_fixups_early = . ; \
  39. *(.pci_fixup_early) \
  40. ___end_pci_fixups_early = . ; \
  41. ___start_pci_fixups_header = . ; \
  42. *(.pci_fixup_header) \
  43. ___end_pci_fixups_header = . ; \
  44. ___start_pci_fixups_final = . ; \
  45. *(.pci_fixup_final) \
  46. ___end_pci_fixups_final = . ; \
  47. ___start_pci_fixups_enable = . ; \
  48. *(.pci_fixup_enable) \
  49. ___end_pci_fixups_enable = . ; \
  50. /* Kernel symbol table: Normal symbols */ \
  51. ___start___ksymtab = .; \
  52. *(__ksymtab) \
  53. ___stop___ksymtab = .; \
  54. /* Kernel symbol table: GPL-only symbols */ \
  55. ___start___ksymtab_gpl = .; \
  56. *(__ksymtab_gpl) \
  57. ___stop___ksymtab_gpl = .; \
  58. /* Kernel symbol table: GPL-future symbols */ \
  59. ___start___ksymtab_gpl_future = .; \
  60. *(__ksymtab_gpl_future) \
  61. ___stop___ksymtab_gpl_future = .; \
  62. /* Kernel symbol table: strings */ \
  63. *(__ksymtab_strings) \
  64. /* Kernel symbol table: Normal symbols */ \
  65. ___start___kcrctab = .; \
  66. *(__kcrctab) \
  67. ___stop___kcrctab = .; \
  68. /* Kernel symbol table: GPL-only symbols */ \
  69. ___start___kcrctab_gpl = .; \
  70. *(__kcrctab_gpl) \
  71. ___stop___kcrctab_gpl = .; \
  72. /* Kernel symbol table: GPL-future symbols */ \
  73. ___start___kcrctab_gpl_future = .; \
  74. *(__kcrctab_gpl_future) \
  75. ___stop___kcrctab_gpl_future = .; \
  76. /* Built-in module parameters */ \
  77. . = ALIGN (4) ; \
  78. ___start___param = .; \
  79. *(__param) \
  80. ___stop___param = .;
  81. /* Kernel text segment, and some constant data areas. */
  82. #define TEXT_CONTENTS \
  83. __stext = . ; \
  84. *(.text) \
  85. SCHED_TEXT \
  86. *(.exit.text) /* 2.5 convention */ \
  87. *(.text.exit) /* 2.4 convention */ \
  88. *(.text.lock) \
  89. *(.exitcall.exit) \
  90. __real_etext = . ; /* There may be data after here. */ \
  91. RODATA_CONTENTS \
  92. . = ALIGN (4) ; \
  93. *(.call_table_data) \
  94. *(.call_table_text) \
  95. . = ALIGN (16) ; /* Exception table. */ \
  96. ___start___ex_table = . ; \
  97. *(__ex_table) \
  98. ___stop___ex_table = . ; \
  99. . = ALIGN (4) ; \
  100. __etext = . ;
  101. /* Kernel data segment. */
  102. #define DATA_CONTENTS \
  103. __sdata = . ; \
  104. *(.data) \
  105. *(.exit.data) /* 2.5 convention */ \
  106. *(.data.exit) /* 2.4 convention */ \
  107. . = ALIGN (16) ; \
  108. *(.data.cacheline_aligned) \
  109. . = ALIGN (0x2000) ; \
  110. *(.data.init_task) \
  111. . = ALIGN (0x2000) ; \
  112. __edata = . ;
  113. /* Kernel BSS segment. */
  114. #define BSS_CONTENTS \
  115. __sbss = . ; \
  116. *(.bss) \
  117. *(COMMON) \
  118. . = ALIGN (4) ; \
  119. __init_stack_end = . ; \
  120. __ebss = . ;
  121. /* `initcall' tables. */
  122. #define INITCALL_CONTENTS \
  123. . = ALIGN (16) ; \
  124. ___setup_start = . ; \
  125. *(.init.setup) /* 2.5 convention */ \
  126. *(.setup.init) /* 2.4 convention */ \
  127. ___setup_end = . ; \
  128. ___initcall_start = . ; \
  129. *(.initcall.init) \
  130. INITCALLS \
  131. . = ALIGN (4) ; \
  132. ___initcall_end = . ; \
  133. ___con_initcall_start = .; \
  134. *(.con_initcall.init) \
  135. ___con_initcall_end = .;
  136. /* Contents of `init' section for a kernel that's loaded into RAM. */
  137. #define RAMK_INIT_CONTENTS \
  138. RAMK_INIT_CONTENTS_NO_END \
  139. __init_end = . ;
  140. /* Same as RAMK_INIT_CONTENTS, but doesn't define the `__init_end' symbol. */
  141. #define RAMK_INIT_CONTENTS_NO_END \
  142. . = ALIGN (4096) ; \
  143. __init_start = . ; \
  144. __sinittext = .; \
  145. *(.init.text) /* 2.5 convention */ \
  146. __einittext = .; \
  147. *(.init.data) \
  148. *(.text.init) /* 2.4 convention */ \
  149. *(.data.init) \
  150. INITCALL_CONTENTS \
  151. INITRAMFS_CONTENTS
  152. /* The contents of `init' section for a ROM-resident kernel which
  153. should go into RAM. */
  154. #define ROMK_INIT_RAM_CONTENTS \
  155. . = ALIGN (4096) ; \
  156. __init_start = . ; \
  157. *(.init.data) /* 2.5 convention */ \
  158. *(.data.init) /* 2.4 convention */ \
  159. __init_end = . ; \
  160. . = ALIGN (4096) ;
  161. /* The contents of `init' section for a ROM-resident kernel which
  162. should go into ROM. */
  163. #define ROMK_INIT_ROM_CONTENTS \
  164. _sinittext = .; \
  165. *(.init.text) /* 2.5 convention */ \
  166. _einittext = .; \
  167. *(.text.init) /* 2.4 convention */ \
  168. INITCALL_CONTENTS \
  169. INITRAMFS_CONTENTS
  170. /* A root filesystem image, for kernels with an embedded root filesystem. */
  171. #define ROOT_FS_CONTENTS \
  172. __root_fs_image_start = . ; \
  173. *(.root) \
  174. __root_fs_image_end = . ;
  175. /* The initramfs archive. */
  176. #define INITRAMFS_CONTENTS \
  177. . = ALIGN (4) ; \
  178. ___initramfs_start = . ; \
  179. *(.init.ramfs) \
  180. ___initramfs_end = . ;
  181. /* Where the initial bootmap (bitmap for the boot-time memory allocator)
  182. should be place. */
  183. #define BOOTMAP_CONTENTS \
  184. . = ALIGN (4096) ; \
  185. __bootmap = . ; \
  186. . = . + 4096 ; /* enough for 128MB. */
  187. /* The contents of a `typical' kram area for a kernel in RAM. */
  188. #define RAMK_KRAM_CONTENTS \
  189. __kram_start = . ; \
  190. TEXT_CONTENTS \
  191. DATA_CONTENTS \
  192. BSS_CONTENTS \
  193. RAMK_INIT_CONTENTS \
  194. __kram_end = . ; \
  195. BOOTMAP_CONTENTS
  196. /* Define output sections normally used for a ROM-resident kernel.
  197. ROM and RAM should be appropriate memory areas to use for kernel
  198. ROM and RAM data. This assumes that ROM starts at 0 (and thus can
  199. hold the interrupt vectors). */
  200. #define ROMK_SECTIONS(ROM, RAM) \
  201. .rom : { \
  202. INTV_CONTENTS \
  203. TEXT_CONTENTS \
  204. ROMK_INIT_ROM_CONTENTS \
  205. ROOT_FS_CONTENTS \
  206. } > ROM \
  207. \
  208. __rom_copy_src_start = . ; \
  209. \
  210. .data : { \
  211. __kram_start = . ; \
  212. __rom_copy_dst_start = . ; \
  213. DATA_CONTENTS \
  214. ROMK_INIT_RAM_CONTENTS \
  215. __rom_copy_dst_end = . ; \
  216. } > RAM AT> ROM \
  217. \
  218. .bss ALIGN (4) : { \
  219. BSS_CONTENTS \
  220. __kram_end = . ; \
  221. BOOTMAP_CONTENTS \
  222. } > RAM
  223. /* The 32-bit variable `jiffies' is just the lower 32-bits of `jiffies_64'. */
  224. _jiffies = _jiffies_64 ;
  225. /* Include an appropriate platform-dependent linker-script (which
  226. usually should use the above macros to do most of the work). */
  227. #ifdef CONFIG_V850E_SIM
  228. # include "sim.ld"
  229. #endif
  230. #ifdef CONFIG_V850E2_SIM85E2
  231. # include "sim85e2.ld"
  232. #endif
  233. #ifdef CONFIG_V850E2_FPGA85E2C
  234. # include "fpga85e2c.ld"
  235. #endif
  236. #ifdef CONFIG_V850E2_ANNA
  237. # ifdef CONFIG_ROM_KERNEL
  238. # include "anna-rom.ld"
  239. # else
  240. # include "anna.ld"
  241. # endif
  242. #endif
  243. #ifdef CONFIG_V850E_AS85EP1
  244. # ifdef CONFIG_ROM_KERNEL
  245. # include "as85ep1-rom.ld"
  246. # else
  247. # include "as85ep1.ld"
  248. # endif
  249. #endif
  250. #ifdef CONFIG_RTE_CB_MA1
  251. # ifdef CONFIG_ROM_KERNEL
  252. # include "rte_ma1_cb-rom.ld"
  253. # else
  254. # include "rte_ma1_cb.ld"
  255. # endif
  256. #endif
  257. #ifdef CONFIG_RTE_CB_NB85E
  258. # ifdef CONFIG_ROM_KERNEL
  259. # include "rte_nb85e_cb-rom.ld"
  260. # elif defined(CONFIG_RTE_CB_MULTI)
  261. # include "rte_nb85e_cb-multi.ld"
  262. # else
  263. # include "rte_nb85e_cb.ld"
  264. # endif
  265. #endif
  266. #ifdef CONFIG_RTE_CB_ME2
  267. # include "rte_me2_cb.ld"
  268. #endif