vmlinux.lds.S 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  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. *(.initcall1.init) \
  131. *(.initcall2.init) \
  132. *(.initcall3.init) \
  133. *(.initcall4.init) \
  134. *(.initcall5.init) \
  135. *(.initcall6.init) \
  136. *(.initcall7.init) \
  137. . = ALIGN (4) ; \
  138. ___initcall_end = . ; \
  139. ___con_initcall_start = .; \
  140. *(.con_initcall.init) \
  141. ___con_initcall_end = .;
  142. /* Contents of `init' section for a kernel that's loaded into RAM. */
  143. #define RAMK_INIT_CONTENTS \
  144. RAMK_INIT_CONTENTS_NO_END \
  145. __init_end = . ;
  146. /* Same as RAMK_INIT_CONTENTS, but doesn't define the `__init_end' symbol. */
  147. #define RAMK_INIT_CONTENTS_NO_END \
  148. . = ALIGN (4096) ; \
  149. __init_start = . ; \
  150. __sinittext = .; \
  151. *(.init.text) /* 2.5 convention */ \
  152. __einittext = .; \
  153. *(.init.data) \
  154. *(.text.init) /* 2.4 convention */ \
  155. *(.data.init) \
  156. INITCALL_CONTENTS \
  157. INITRAMFS_CONTENTS
  158. /* The contents of `init' section for a ROM-resident kernel which
  159. should go into RAM. */
  160. #define ROMK_INIT_RAM_CONTENTS \
  161. . = ALIGN (4096) ; \
  162. __init_start = . ; \
  163. *(.init.data) /* 2.5 convention */ \
  164. *(.data.init) /* 2.4 convention */ \
  165. __init_end = . ; \
  166. . = ALIGN (4096) ;
  167. /* The contents of `init' section for a ROM-resident kernel which
  168. should go into ROM. */
  169. #define ROMK_INIT_ROM_CONTENTS \
  170. _sinittext = .; \
  171. *(.init.text) /* 2.5 convention */ \
  172. _einittext = .; \
  173. *(.text.init) /* 2.4 convention */ \
  174. INITCALL_CONTENTS \
  175. INITRAMFS_CONTENTS
  176. /* A root filesystem image, for kernels with an embedded root filesystem. */
  177. #define ROOT_FS_CONTENTS \
  178. __root_fs_image_start = . ; \
  179. *(.root) \
  180. __root_fs_image_end = . ;
  181. /* The initramfs archive. */
  182. #define INITRAMFS_CONTENTS \
  183. . = ALIGN (4) ; \
  184. ___initramfs_start = . ; \
  185. *(.init.ramfs) \
  186. ___initramfs_end = . ;
  187. /* Where the initial bootmap (bitmap for the boot-time memory allocator)
  188. should be place. */
  189. #define BOOTMAP_CONTENTS \
  190. . = ALIGN (4096) ; \
  191. __bootmap = . ; \
  192. . = . + 4096 ; /* enough for 128MB. */
  193. /* The contents of a `typical' kram area for a kernel in RAM. */
  194. #define RAMK_KRAM_CONTENTS \
  195. __kram_start = . ; \
  196. TEXT_CONTENTS \
  197. DATA_CONTENTS \
  198. BSS_CONTENTS \
  199. RAMK_INIT_CONTENTS \
  200. __kram_end = . ; \
  201. BOOTMAP_CONTENTS
  202. /* Define output sections normally used for a ROM-resident kernel.
  203. ROM and RAM should be appropriate memory areas to use for kernel
  204. ROM and RAM data. This assumes that ROM starts at 0 (and thus can
  205. hold the interrupt vectors). */
  206. #define ROMK_SECTIONS(ROM, RAM) \
  207. .rom : { \
  208. INTV_CONTENTS \
  209. TEXT_CONTENTS \
  210. ROMK_INIT_ROM_CONTENTS \
  211. ROOT_FS_CONTENTS \
  212. } > ROM \
  213. \
  214. __rom_copy_src_start = . ; \
  215. \
  216. .data : { \
  217. __kram_start = . ; \
  218. __rom_copy_dst_start = . ; \
  219. DATA_CONTENTS \
  220. ROMK_INIT_RAM_CONTENTS \
  221. __rom_copy_dst_end = . ; \
  222. } > RAM AT> ROM \
  223. \
  224. .bss ALIGN (4) : { \
  225. BSS_CONTENTS \
  226. __kram_end = . ; \
  227. BOOTMAP_CONTENTS \
  228. } > RAM
  229. /* The 32-bit variable `jiffies' is just the lower 32-bits of `jiffies_64'. */
  230. _jiffies = _jiffies_64 ;
  231. /* Include an appropriate platform-dependent linker-script (which
  232. usually should use the above macros to do most of the work). */
  233. #ifdef CONFIG_V850E_SIM
  234. # include "sim.ld"
  235. #endif
  236. #ifdef CONFIG_V850E2_SIM85E2
  237. # include "sim85e2.ld"
  238. #endif
  239. #ifdef CONFIG_V850E2_FPGA85E2C
  240. # include "fpga85e2c.ld"
  241. #endif
  242. #ifdef CONFIG_V850E2_ANNA
  243. # ifdef CONFIG_ROM_KERNEL
  244. # include "anna-rom.ld"
  245. # else
  246. # include "anna.ld"
  247. # endif
  248. #endif
  249. #ifdef CONFIG_V850E_AS85EP1
  250. # ifdef CONFIG_ROM_KERNEL
  251. # include "as85ep1-rom.ld"
  252. # else
  253. # include "as85ep1.ld"
  254. # endif
  255. #endif
  256. #ifdef CONFIG_RTE_CB_MA1
  257. # ifdef CONFIG_ROM_KERNEL
  258. # include "rte_ma1_cb-rom.ld"
  259. # else
  260. # include "rte_ma1_cb.ld"
  261. # endif
  262. #endif
  263. #ifdef CONFIG_RTE_CB_NB85E
  264. # ifdef CONFIG_ROM_KERNEL
  265. # include "rte_nb85e_cb-rom.ld"
  266. # elif defined(CONFIG_RTE_CB_MULTI)
  267. # include "rte_nb85e_cb-multi.ld"
  268. # else
  269. # include "rte_nb85e_cb.ld"
  270. # endif
  271. #endif
  272. #ifdef CONFIG_RTE_CB_ME2
  273. # include "rte_me2_cb.ld"
  274. #endif