vmlinux.lds.S 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306
  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_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_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. #ifdef CONFIG_BLK_DEV_INITRD
  177. /* The initramfs archive. */
  178. #define INITRAMFS_CONTENTS \
  179. . = ALIGN (4) ; \
  180. ___initramfs_start = . ; \
  181. *(.init.ramfs) \
  182. ___initramfs_end = . ;
  183. #endif
  184. /* Where the initial bootmap (bitmap for the boot-time memory allocator)
  185. should be place. */
  186. #define BOOTMAP_CONTENTS \
  187. . = ALIGN (4096) ; \
  188. __bootmap = . ; \
  189. . = . + 4096 ; /* enough for 128MB. */
  190. /* The contents of a `typical' kram area for a kernel in RAM. */
  191. #define RAMK_KRAM_CONTENTS \
  192. __kram_start = . ; \
  193. TEXT_CONTENTS \
  194. DATA_CONTENTS \
  195. BSS_CONTENTS \
  196. RAMK_INIT_CONTENTS \
  197. __kram_end = . ; \
  198. BOOTMAP_CONTENTS
  199. /* Define output sections normally used for a ROM-resident kernel.
  200. ROM and RAM should be appropriate memory areas to use for kernel
  201. ROM and RAM data. This assumes that ROM starts at 0 (and thus can
  202. hold the interrupt vectors). */
  203. #define ROMK_SECTIONS(ROM, RAM) \
  204. .rom : { \
  205. INTV_CONTENTS \
  206. TEXT_CONTENTS \
  207. ROMK_INIT_ROM_CONTENTS \
  208. ROOT_FS_CONTENTS \
  209. } > ROM \
  210. \
  211. __rom_copy_src_start = . ; \
  212. \
  213. .data : { \
  214. __kram_start = . ; \
  215. __rom_copy_dst_start = . ; \
  216. DATA_CONTENTS \
  217. ROMK_INIT_RAM_CONTENTS \
  218. __rom_copy_dst_end = . ; \
  219. } > RAM AT> ROM \
  220. \
  221. .bss ALIGN (4) : { \
  222. BSS_CONTENTS \
  223. __kram_end = . ; \
  224. BOOTMAP_CONTENTS \
  225. } > RAM
  226. /* The 32-bit variable `jiffies' is just the lower 32-bits of `jiffies_64'. */
  227. _jiffies = _jiffies_64 ;
  228. /* Include an appropriate platform-dependent linker-script (which
  229. usually should use the above macros to do most of the work). */
  230. #ifdef CONFIG_V850E_SIM
  231. # include "sim.ld"
  232. #endif
  233. #ifdef CONFIG_V850E2_SIM85E2
  234. # include "sim85e2.ld"
  235. #endif
  236. #ifdef CONFIG_V850E2_FPGA85E2C
  237. # include "fpga85e2c.ld"
  238. #endif
  239. #ifdef CONFIG_V850E2_ANNA
  240. # ifdef CONFIG_ROM_KERNEL
  241. # include "anna-rom.ld"
  242. # else
  243. # include "anna.ld"
  244. # endif
  245. #endif
  246. #ifdef CONFIG_V850E_AS85EP1
  247. # ifdef CONFIG_ROM_KERNEL
  248. # include "as85ep1-rom.ld"
  249. # else
  250. # include "as85ep1.ld"
  251. # endif
  252. #endif
  253. #ifdef CONFIG_RTE_CB_MA1
  254. # ifdef CONFIG_ROM_KERNEL
  255. # include "rte_ma1_cb-rom.ld"
  256. # else
  257. # include "rte_ma1_cb.ld"
  258. # endif
  259. #endif
  260. #ifdef CONFIG_RTE_CB_NB85E
  261. # ifdef CONFIG_ROM_KERNEL
  262. # include "rte_nb85e_cb-rom.ld"
  263. # elif defined(CONFIG_RTE_CB_MULTI)
  264. # include "rte_nb85e_cb-multi.ld"
  265. # else
  266. # include "rte_nb85e_cb.ld"
  267. # endif
  268. #endif
  269. #ifdef CONFIG_RTE_CB_ME2
  270. # include "rte_me2_cb.ld"
  271. #endif