blob: d5f28e40717c2eccbb6c26c2c8a421e21f7c7b47 [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
Mikael Starvik51533b62005-07-27 11:44:44 -070011#include <asm-generic/vmlinux.lds.h>
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010012#include <asm/page.h>
13
14#ifdef CONFIG_ETRAX_VMEM_SIZE
15#define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
16#else
17#define __CONFIG_ETRAX_VMEM_SIZE 0
18#endif
Mikael Starvik51533b62005-07-27 11:44:44 -070019
20jiffies = jiffies_64;
21SECTIONS
22{
23 . = DRAM_VIRTUAL_BASE;
24 dram_start = .;
25 ebp_start = .;
26
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010027 /* The boot section is only necessary until the VCS top */
28 /* level testbench includes both flash and DRAM. */
Mikael Starvik51533b62005-07-27 11:44:44 -070029 .boot : { *(.boot) }
30
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010031 /* See head.S and pages reserved at the start. */
32 . = DRAM_VIRTUAL_BASE + 0x4000;
Mikael Starvik51533b62005-07-27 11:44:44 -070033
34 _text = .; /* Text and read-only data. */
35 text_start = .; /* Lots of aliases. */
36 _stext = .;
37 __stext = .;
38 .text : {
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010039 TEXT_TEXT
Mikael Starvik51533b62005-07-27 11:44:44 -070040 SCHED_TEXT
41 LOCK_TEXT
42 *(.fixup)
43 *(.text.__*)
44 }
45
46 _etext = . ; /* End of text section. */
47 __etext = .;
48
49 . = ALIGN(4); /* Exception table. */
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010050 __start___ex_table = .;
51 __ex_table : { *(__ex_table) }
52 __stop___ex_table = .;
Mikael Starvik51533b62005-07-27 11:44:44 -070053
54 RODATA
55
56 . = ALIGN (4);
57 ___data_start = . ;
58 __Sdata = . ;
59 .data : { /* Data */
Mathieu Desnoyers5c617c62007-06-16 22:28:26 -040060 DATA_DATA
Mikael Starvik51533b62005-07-27 11:44:44 -070061 }
62 __edata = . ; /* End of data section. */
63 _edata = . ;
64
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010065 . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */
66 .data.init_task : { *(.data.init_task) }
Mikael Starvik51533b62005-07-27 11:44:44 -070067
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010068 . = ALIGN(PAGE_SIZE); /* Init code and data. */
69 __init_begin = .;
Mikael Starvik51533b62005-07-27 11:44:44 -070070 .init.text : {
71 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010072 INIT_TEXT
Mikael Starvik51533b62005-07-27 11:44:44 -070073 _einittext = .;
74 }
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010075 .init.data : { INIT_DATA }
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010076 . = ALIGN(16);
77 __setup_start = .;
78 .init.setup : { *(.init.setup) }
79 __setup_end = .;
Mikael Starvik51533b62005-07-27 11:44:44 -070080 __start___param = .;
81 __param : { *(__param) }
82 __stop___param = .;
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010083 .initcall.init : {
Mikael Starvik51533b62005-07-27 11:44:44 -070084 __initcall_start = .;
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010085 INITCALLS
Mikael Starvik51533b62005-07-27 11:44:44 -070086 __initcall_end = .;
87 }
88
89 .con_initcall.init : {
90 __con_initcall_start = .;
91 *(.con_initcall.init)
92 __con_initcall_end = .;
93 }
94 SECURITY_INIT
95
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010096 __vmlinux_end = .; /* Last address of the physical file. */
97 PERCPU(PAGE_SIZE)
Mikael Starvik51533b62005-07-27 11:44:44 -070098
99 .init.ramfs : {
100 __initramfs_start = .;
101 *(.init.ramfs)
102 __initramfs_end = .;
Mikael Starvik51533b62005-07-27 11:44:44 -0700103 }
Mikael Starvik51533b62005-07-27 11:44:44 -0700104
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100105 /*
106 * We fill to the next page, so we can discard all init
107 * pages without needing to consider what payload might be
108 * appended to the kernel image.
109 */
110 . = ALIGN (PAGE_SIZE);
111
112 __init_end = .;
Mikael Starvik51533b62005-07-27 11:44:44 -0700113
114 __data_end = . ; /* Move to _edata? */
115 __bss_start = .; /* BSS. */
116 .bss : {
117 *(COMMON)
118 *(.bss)
119 }
120
121 . = ALIGN (0x20);
122 _end = .;
123 __end = .;
124
125 /* Sections to be discarded */
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100126 /DISCARD/ : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100127 EXIT_TEXT
128 EXIT_DATA
Mikael Starvik51533b62005-07-27 11:44:44 -0700129 *(.exitcall.exit)
130 }
131
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100132 dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
Mikael Starvik51533b62005-07-27 11:44:44 -0700133}