blob: bbfda67d2907009c34af0d1b3f3ecd35ec03e47e [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 Nilsson24924ec2009-09-23 13:21:57 +020054 EXCEPTION_TABLE(4)
Mikael Starvik51533b62005-07-27 11:44:44 -070055
56 RODATA
57
58 . = ALIGN (4);
59 ___data_start = . ;
60 __Sdata = . ;
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020061 .data : { /* Data */
Mathieu Desnoyers5c617c62007-06-16 22:28:26 -040062 DATA_DATA
Mikael Starvik51533b62005-07-27 11:44:44 -070063 }
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020064 __edata = . ; /* End of data section. */
Mikael Starvik51533b62005-07-27 11:44:44 -070065 _edata = . ;
66
Jesper Nilsson24924ec2009-09-23 13:21:57 +020067 INIT_TASK_DATA_SECTION(PAGE_SIZE)
Mikael Starvik51533b62005-07-27 11:44:44 -070068
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020069 . = ALIGN(PAGE_SIZE); /* Init code and data. */
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010070 __init_begin = .;
Jesper Nilsson24924ec2009-09-23 13:21:57 +020071 INIT_TEXT_SECTION(PAGE_SIZE)
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010072 .init.data : { INIT_DATA }
Jesper Nilsson24924ec2009-09-23 13:21:57 +020073 .init.setup : { INIT_SETUP(16) }
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020074#ifdef CONFIG_ETRAX_ARCH_V32
Mikael Starvik51533b62005-07-27 11:44:44 -070075 __start___param = .;
76 __param : { *(__param) }
77 __stop___param = .;
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020078#endif
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010079 .initcall.init : {
Jesper Nilsson24924ec2009-09-23 13:21:57 +020080 INIT_CALLS
Mikael Starvik51533b62005-07-27 11:44:44 -070081 }
82
83 .con_initcall.init : {
Jesper Nilsson24924ec2009-09-23 13:21:57 +020084 CON_INITCALL
Mikael Starvik51533b62005-07-27 11:44:44 -070085 }
86 SECURITY_INIT
87
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +020088#ifdef CONFIG_ETRAX_ARCH_V10
89#ifdef CONFIG_BLK_DEV_INITRD
90 .init.ramfs : {
91 __initramfs_start = .;
92 *(.init.ramfs)
93 __initramfs_end = .;
94 }
95#endif
96#endif
97 __vmlinux_end = .; /* Last address of the physical file. */
98#ifdef CONFIG_ETRAX_ARCH_V32
Jesper Nilssonbaa69b12008-01-30 12:57:31 +010099 PERCPU(PAGE_SIZE)
Mikael Starvik51533b62005-07-27 11:44:44 -0700100
101 .init.ramfs : {
Jesper Nilsson24924ec2009-09-23 13:21:57 +0200102 INIT_RAM_FS
Mikael Starvik51533b62005-07-27 11:44:44 -0700103 }
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +0200104#endif
Mikael Starvik51533b62005-07-27 11:44:44 -0700105
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100106 /*
107 * We fill to the next page, so we can discard all init
108 * pages without needing to consider what payload might be
109 * appended to the kernel image.
110 */
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +0200111 . = ALIGN(PAGE_SIZE);
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100112
113 __init_end = .;
Mikael Starvik51533b62005-07-27 11:44:44 -0700114
Jesper Nilssonc5ec6fb2008-10-22 23:57:53 +0200115 __data_end = . ; /* Move to _edata ? */
Jesper Nilsson24924ec2009-09-23 13:21:57 +0200116 BSS_SECTION(0, 0, 0)
Mikael Starvik51533b62005-07-27 11:44:44 -0700117
118 . = ALIGN (0x20);
119 _end = .;
120 __end = .;
121
Jesper Nilssonbaa69b12008-01-30 12:57:31 +0100122 dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024;
Tejun Heo023bf6f2009-07-09 11:27:40 +0900123
124 DISCARDS
Mikael Starvik51533b62005-07-27 11:44:44 -0700125}