vmlinux.lds.S 9.3 KB

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