vmlinux.lds.S 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  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: strings */ \
  60. *(__ksymtab_strings) \
  61. /* Kernel symbol table: Normal symbols */ \
  62. ___start___kcrctab = .; \
  63. *(__kcrctab) \
  64. ___stop___kcrctab = .; \
  65. /* Kernel symbol table: GPL-only symbols */ \
  66. ___start___kcrctab_gpl = .; \
  67. *(__kcrctab_gpl) \
  68. ___stop___kcrctab_gpl = .; \
  69. /* Built-in module parameters */ \
  70. . = ALIGN (4) ; \
  71. ___start___param = .; \
  72. *(__param) \
  73. ___stop___param = .;
  74. /* Kernel text segment, and some constant data areas. */
  75. #define TEXT_CONTENTS \
  76. __stext = . ; \
  77. *(.text) \
  78. SCHED_TEXT \
  79. *(.exit.text) /* 2.5 convention */ \
  80. *(.text.exit) /* 2.4 convention */ \
  81. *(.text.lock) \
  82. *(.exitcall.exit) \
  83. __real_etext = . ; /* There may be data after here. */ \
  84. RODATA_CONTENTS \
  85. . = ALIGN (4) ; \
  86. *(.call_table_data) \
  87. *(.call_table_text) \
  88. . = ALIGN (16) ; /* Exception table. */ \
  89. ___start___ex_table = . ; \
  90. *(__ex_table) \
  91. ___stop___ex_table = . ; \
  92. . = ALIGN (4) ; \
  93. __etext = . ;
  94. /* Kernel data segment. */
  95. #define DATA_CONTENTS \
  96. __sdata = . ; \
  97. *(.data) \
  98. *(.exit.data) /* 2.5 convention */ \
  99. *(.data.exit) /* 2.4 convention */ \
  100. . = ALIGN (16) ; \
  101. *(.data.cacheline_aligned) \
  102. . = ALIGN (0x2000) ; \
  103. *(.data.init_task) \
  104. . = ALIGN (0x2000) ; \
  105. __edata = . ;
  106. /* Kernel BSS segment. */
  107. #define BSS_CONTENTS \
  108. __sbss = . ; \
  109. *(.bss) \
  110. *(COMMON) \
  111. . = ALIGN (4) ; \
  112. __init_stack_end = . ; \
  113. __ebss = . ;
  114. /* `initcall' tables. */
  115. #define INITCALL_CONTENTS \
  116. . = ALIGN (16) ; \
  117. ___setup_start = . ; \
  118. *(.init.setup) /* 2.5 convention */ \
  119. *(.setup.init) /* 2.4 convention */ \
  120. ___setup_end = . ; \
  121. ___initcall_start = . ; \
  122. *(.initcall.init) \
  123. *(.initcall1.init) \
  124. *(.initcall2.init) \
  125. *(.initcall3.init) \
  126. *(.initcall4.init) \
  127. *(.initcall5.init) \
  128. *(.initcall6.init) \
  129. *(.initcall7.init) \
  130. . = ALIGN (4) ; \
  131. ___initcall_end = . ; \
  132. ___con_initcall_start = .; \
  133. *(.con_initcall.init) \
  134. ___con_initcall_end = .;
  135. /* Contents of `init' section for a kernel that's loaded into RAM. */
  136. #define RAMK_INIT_CONTENTS \
  137. RAMK_INIT_CONTENTS_NO_END \
  138. __init_end = . ;
  139. /* Same as RAMK_INIT_CONTENTS, but doesn't define the `__init_end' symbol. */
  140. #define RAMK_INIT_CONTENTS_NO_END \
  141. . = ALIGN (4096) ; \
  142. __init_start = . ; \
  143. __sinittext = .; \
  144. *(.init.text) /* 2.5 convention */ \
  145. __einittext = .; \
  146. *(.init.data) \
  147. *(.text.init) /* 2.4 convention */ \
  148. *(.data.init) \
  149. INITCALL_CONTENTS \
  150. INITRAMFS_CONTENTS
  151. /* The contents of `init' section for a ROM-resident kernel which
  152. should go into RAM. */
  153. #define ROMK_INIT_RAM_CONTENTS \
  154. . = ALIGN (4096) ; \
  155. __init_start = . ; \
  156. *(.init.data) /* 2.5 convention */ \
  157. *(.data.init) /* 2.4 convention */ \
  158. __init_end = . ; \
  159. . = ALIGN (4096) ;
  160. /* The contents of `init' section for a ROM-resident kernel which
  161. should go into ROM. */
  162. #define ROMK_INIT_ROM_CONTENTS \
  163. _sinittext = .; \
  164. *(.init.text) /* 2.5 convention */ \
  165. _einittext = .; \
  166. *(.text.init) /* 2.4 convention */ \
  167. INITCALL_CONTENTS \
  168. INITRAMFS_CONTENTS
  169. /* A root filesystem image, for kernels with an embedded root filesystem. */
  170. #define ROOT_FS_CONTENTS \
  171. __root_fs_image_start = . ; \
  172. *(.root) \
  173. __root_fs_image_end = . ;
  174. /* The initramfs archive. */
  175. #define INITRAMFS_CONTENTS \
  176. . = ALIGN (4) ; \
  177. ___initramfs_start = . ; \
  178. *(.init.ramfs) \
  179. ___initramfs_end = . ;
  180. /* Where the initial bootmap (bitmap for the boot-time memory allocator)
  181. should be place. */
  182. #define BOOTMAP_CONTENTS \
  183. . = ALIGN (4096) ; \
  184. __bootmap = . ; \
  185. . = . + 4096 ; /* enough for 128MB. */
  186. /* The contents of a `typical' kram area for a kernel in RAM. */
  187. #define RAMK_KRAM_CONTENTS \
  188. __kram_start = . ; \
  189. TEXT_CONTENTS \
  190. DATA_CONTENTS \
  191. BSS_CONTENTS \
  192. RAMK_INIT_CONTENTS \
  193. __kram_end = . ; \
  194. BOOTMAP_CONTENTS
  195. /* Define output sections normally used for a ROM-resident kernel.
  196. ROM and RAM should be appropriate memory areas to use for kernel
  197. ROM and RAM data. This assumes that ROM starts at 0 (and thus can
  198. hold the interrupt vectors). */
  199. #define ROMK_SECTIONS(ROM, RAM) \
  200. .rom : { \
  201. INTV_CONTENTS \
  202. TEXT_CONTENTS \
  203. ROMK_INIT_ROM_CONTENTS \
  204. ROOT_FS_CONTENTS \
  205. } > ROM \
  206. \
  207. __rom_copy_src_start = . ; \
  208. \
  209. .data : { \
  210. __kram_start = . ; \
  211. __rom_copy_dst_start = . ; \
  212. DATA_CONTENTS \
  213. ROMK_INIT_RAM_CONTENTS \
  214. __rom_copy_dst_end = . ; \
  215. } > RAM AT> ROM \
  216. \
  217. .bss ALIGN (4) : { \
  218. BSS_CONTENTS \
  219. __kram_end = . ; \
  220. BOOTMAP_CONTENTS \
  221. } > RAM
  222. /* The 32-bit variable `jiffies' is just the lower 32-bits of `jiffies_64'. */
  223. _jiffies = _jiffies_64 ;
  224. /* Include an appropriate platform-dependent linker-script (which
  225. usually should use the above macros to do most of the work). */
  226. #ifdef CONFIG_V850E_SIM
  227. # include "sim.ld"
  228. #endif
  229. #ifdef CONFIG_V850E2_SIM85E2
  230. # include "sim85e2.ld"
  231. #endif
  232. #ifdef CONFIG_V850E2_FPGA85E2C
  233. # include "fpga85e2c.ld"
  234. #endif
  235. #ifdef CONFIG_V850E2_ANNA
  236. # ifdef CONFIG_ROM_KERNEL
  237. # include "anna-rom.ld"
  238. # else
  239. # include "anna.ld"
  240. # endif
  241. #endif
  242. #ifdef CONFIG_V850E_AS85EP1
  243. # ifdef CONFIG_ROM_KERNEL
  244. # include "as85ep1-rom.ld"
  245. # else
  246. # include "as85ep1.ld"
  247. # endif
  248. #endif
  249. #ifdef CONFIG_RTE_CB_MA1
  250. # ifdef CONFIG_ROM_KERNEL
  251. # include "rte_ma1_cb-rom.ld"
  252. # else
  253. # include "rte_ma1_cb.ld"
  254. # endif
  255. #endif
  256. #ifdef CONFIG_RTE_CB_NB85E
  257. # ifdef CONFIG_ROM_KERNEL
  258. # include "rte_nb85e_cb-rom.ld"
  259. # elif defined(CONFIG_RTE_CB_MULTI)
  260. # include "rte_nb85e_cb-multi.ld"
  261. # else
  262. # include "rte_nb85e_cb.ld"
  263. # endif
  264. #endif
  265. #ifdef CONFIG_RTE_CB_ME2
  266. # include "rte_me2_cb.ld"
  267. #endif