vmlinux.lds.S 9.5 KB

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