blob: 0d2adfc794d49d0bcb8e4a63f3671875dbd7e816 [file] [log] [blame]
Mikael Starvik51533b62005-07-27 11:44:44 -07001/* ld script to make the Linux/CRIS kernel
2 * Authors: Bjorn Wesen (bjornw@axis.com)
3 *
4 * It is VERY DANGEROUS to fiddle around with the symbols in this
5 * script. It is for example quite vital that all generated sections
6 * that are used are actually named here, otherwise the linker will
7 * put them at the end, where the init stuff is which is FREED after
8 * the kernel has booted.
9 */
10
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020011#include <linux/autoconf.h>
Mikael Starvik51533b62005-07-27 11:44:44 -070012#include <asm-generic/vmlinux.lds.h>
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010013#include <asm/page.h>
14
15#ifdef CONFIG_ETRAX_VMEM_SIZE
16#define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
17#else
18#define __CONFIG_ETRAX_VMEM_SIZE 0
19#endif
Mikael Starvik51533b62005-07-27 11:44:44 -070020
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020021
Mikael Starvik51533b62005-07-27 11:44:44 -070022jiffies = jiffies_64;
23SECTIONS
24{
25 . = DRAM_VIRTUAL_BASE;
26 dram_start = .;
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020027#ifdef CONFIG_ETRAX_ARCH_V10
28 ibr_start = .;
29#else
Mikael Starvik51533b62005-07-27 11:44:44 -070030 ebp_start = .;
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010031 /* The boot section is only necessary until the VCS top */
32 /* level testbench includes both flash and DRAM. */
Mikael Starvik51533b62005-07-27 11:44:44 -070033 .boot : { *(.boot) }
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020034#endif
Mikael Starvik51533b62005-07-27 11:44:44 -070035
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020036 /* see head.S and pages reserved at the start */
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010037 . = DRAM_VIRTUAL_BASE + 0x4000;
Mikael Starvik51533b62005-07-27 11:44:44 -070038
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020039 _text = .; /* Text and read-only data. */
40 text_start = .; /* Lots of aliases. */
Mikael Starvik51533b62005-07-27 11:44:44 -070041 _stext = .;
42 __stext = .;
43 .text : {
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010044 TEXT_TEXT
Mikael Starvik51533b62005-07-27 11:44:44 -070045 SCHED_TEXT
46 LOCK_TEXT
47 *(.fixup)
48 *(.text.__*)
49 }
50
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020051 _etext = . ; /* End of text section. */
Mikael Starvik51533b62005-07-27 11:44:44 -070052 __etext = .;
53
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020054 . = ALIGN(4); /* Exception table. */
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010055 __start___ex_table = .;
56 __ex_table : { *(__ex_table) }
57 __stop___ex_table = .;
Mikael Starvik51533b62005-07-27 11:44:44 -070058
59 RODATA
60
61 . = ALIGN (4);
62 ___data_start = . ;
63 __Sdata = . ;
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020064 .data : { /* Data */
Mathieu Desnoyers5c617c62007-06-16 22:28:26 -040065 DATA_DATA
Mikael Starvik51533b62005-07-27 11:44:44 -070066 }
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020067 __edata = . ; /* End of data section. */
Mikael Starvik51533b62005-07-27 11:44:44 -070068 _edata = . ;
69
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010070 . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */
71 .data.init_task : { *(.data.init_task) }
Mikael Starvik51533b62005-07-27 11:44:44 -070072
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020073 . = ALIGN(PAGE_SIZE); /* Init code and data. */
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010074 __init_begin = .;
Mikael Starvik51533b62005-07-27 11:44:44 -070075 .init.text : {
76 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010077 INIT_TEXT
Mikael Starvik51533b62005-07-27 11:44:44 -070078 _einittext = .;
79 }
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010080 .init.data : { INIT_DATA }
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010081 . = ALIGN(16);
82 __setup_start = .;
83 .init.setup : { *(.init.setup) }
84 __setup_end = .;
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020085#ifdef CONFIG_ETRAX_ARCH_V32
Mikael Starvik51533b62005-07-27 11:44:44 -070086 __start___param = .;
87 __param : { *(__param) }
88 __stop___param = .;
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020089#endif
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010090 .initcall.init : {
Mikael Starvik51533b62005-07-27 11:44:44 -070091 __initcall_start = .;
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010092 INITCALLS
Mikael Starvik51533b62005-07-27 11:44:44 -070093 __initcall_end = .;
94 }
95
96 .con_initcall.init : {
97 __con_initcall_start = .;
98 *(.con_initcall.init)
99 __con_initcall_end = .;
100 }
101 SECURITY_INIT
102
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +0200103#ifdef CONFIG_ETRAX_ARCH_V10
104#ifdef CONFIG_BLK_DEV_INITRD
105 .init.ramfs : {
106 __initramfs_start = .;
107 *(.init.ramfs)
108 __initramfs_end = .;
109 }
110#endif
111#endif
112 __vmlinux_end = .; /* Last address of the physical file. */
113#ifdef CONFIG_ETRAX_ARCH_V32
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100114 PERCPU(PAGE_SIZE)
Mikael Starvik51533b62005-07-27 11:44:44 -0700115
116 .init.ramfs : {
117 __initramfs_start = .;
118 *(.init.ramfs)
119 __initramfs_end = .;
Mikael Starvik51533b62005-07-27 11:44:44 -0700120 }
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +0200121#endif
Mikael Starvik51533b62005-07-27 11:44:44 -0700122
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100123 /*
124 * We fill to the next page, so we can discard all init
125 * pages without needing to consider what payload might be
126 * appended to the kernel image.
127 */
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +0200128 . = ALIGN(PAGE_SIZE);
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100129
130 __init_end = .;
Mikael Starvik51533b62005-07-27 11:44:44 -0700131
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +0200132 __data_end = . ; /* Move to _edata ? */
133 __bss_start = .; /* BSS. */
Mikael Starvik51533b62005-07-27 11:44:44 -0700134 .bss : {
135 *(COMMON)
136 *(.bss)
137 }
138
139 . = ALIGN (0x20);
140 _end = .;
141 __end = .;
142
143 /* Sections to be discarded */
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100144 /DISCARD/ : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100145 EXIT_TEXT
146 EXIT_DATA
Mikael Starvik51533b62005-07-27 11:44:44 -0700147 *(.exitcall.exit)
148 }
149
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100150 dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
Mikael Starvik51533b62005-07-27 11:44:44 -0700151}