blob: d49d17d2a14f5a36be1e4da6670897734565b4b8 [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
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020020
Mikael Starvik51533b62005-07-27 11:44:44 -070021jiffies = jiffies_64;
22SECTIONS
23{
24 . = DRAM_VIRTUAL_BASE;
25 dram_start = .;
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020026#ifdef CONFIG_ETRAX_ARCH_V10
27 ibr_start = .;
28#else
Mikael Starvik51533b62005-07-27 11:44:44 -070029 ebp_start = .;
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010030 /* The boot section is only necessary until the VCS top */
31 /* level testbench includes both flash and DRAM. */
Mikael Starvik51533b62005-07-27 11:44:44 -070032 .boot : { *(.boot) }
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020033#endif
Mikael Starvik51533b62005-07-27 11:44:44 -070034
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020035 /* see head.S and pages reserved at the start */
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010036 . = DRAM_VIRTUAL_BASE + 0x4000;
Mikael Starvik51533b62005-07-27 11:44:44 -070037
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020038 _text = .; /* Text and read-only data. */
39 text_start = .; /* Lots of aliases. */
Mikael Starvik51533b62005-07-27 11:44:44 -070040 _stext = .;
41 __stext = .;
42 .text : {
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010043 TEXT_TEXT
Mikael Starvik51533b62005-07-27 11:44:44 -070044 SCHED_TEXT
45 LOCK_TEXT
46 *(.fixup)
47 *(.text.__*)
48 }
49
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020050 _etext = . ; /* End of text section. */
Mikael Starvik51533b62005-07-27 11:44:44 -070051 __etext = .;
52
Jesper Nilsson24924ec2009-09-23 13:21:57 +020053 EXCEPTION_TABLE(4)
Mikael Starvik51533b62005-07-27 11:44:44 -070054
55 RODATA
56
57 . = ALIGN (4);
58 ___data_start = . ;
59 __Sdata = . ;
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020060 .data : { /* Data */
Mathieu Desnoyers5c617c62007-06-16 22:28:26 -040061 DATA_DATA
Mikael Starvik51533b62005-07-27 11:44:44 -070062 }
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020063 __edata = . ; /* End of data section. */
Mikael Starvik51533b62005-07-27 11:44:44 -070064 _edata = . ;
65
Jesper Nilsson24924ec2009-09-23 13:21:57 +020066 INIT_TASK_DATA_SECTION(PAGE_SIZE)
Mikael Starvik51533b62005-07-27 11:44:44 -070067
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020068 . = ALIGN(PAGE_SIZE); /* Init code and data. */
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010069 __init_begin = .;
Jesper Nilsson24924ec2009-09-23 13:21:57 +020070 INIT_TEXT_SECTION(PAGE_SIZE)
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010071 .init.data : { INIT_DATA }
Jesper Nilsson24924ec2009-09-23 13:21:57 +020072 .init.setup : { INIT_SETUP(16) }
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020073#ifdef CONFIG_ETRAX_ARCH_V32
Mikael Starvik51533b62005-07-27 11:44:44 -070074 __start___param = .;
75 __param : { *(__param) }
76 __stop___param = .;
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020077#endif
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010078 .initcall.init : {
Jesper Nilsson24924ec2009-09-23 13:21:57 +020079 INIT_CALLS
Mikael Starvik51533b62005-07-27 11:44:44 -070080 }
81
82 .con_initcall.init : {
Jesper Nilsson24924ec2009-09-23 13:21:57 +020083 CON_INITCALL
Mikael Starvik51533b62005-07-27 11:44:44 -070084 }
85 SECURITY_INIT
86
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020087#ifdef CONFIG_ETRAX_ARCH_V10
88#ifdef CONFIG_BLK_DEV_INITRD
89 .init.ramfs : {
90 __initramfs_start = .;
91 *(.init.ramfs)
92 __initramfs_end = .;
93 }
94#endif
95#endif
96 __vmlinux_end = .; /* Last address of the physical file. */
97#ifdef CONFIG_ETRAX_ARCH_V32
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010098 PERCPU(PAGE_SIZE)
Mikael Starvik51533b62005-07-27 11:44:44 -070099
100 .init.ramfs : {
Jesper Nilsson24924ec2009-09-23 13:21:57 +0200101 INIT_RAM_FS
Mikael Starvik51533b62005-07-27 11:44:44 -0700102 }
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +0200103#endif
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 */
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +0200110 . = ALIGN(PAGE_SIZE);
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100111
112 __init_end = .;
Mikael Starvik51533b62005-07-27 11:44:44 -0700113
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +0200114 __data_end = . ; /* Move to _edata ? */
Jesper Nilsson24924ec2009-09-23 13:21:57 +0200115 BSS_SECTION(0, 0, 0)
Mikael Starvik51533b62005-07-27 11:44:44 -0700116
117 . = ALIGN (0x20);
118 _end = .;
119 __end = .;
120
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100121 dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
Tejun Heo023bf6f2009-07-09 11:27:40 +0900122
123 DISCARDS
Mikael Starvik51533b62005-07-27 11:44:44 -0700124}