]>
Commit | Line | Data |
---|---|---|
51533b61 MS |
1 | /* 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 | ||
c5ec6fb0 | 11 | #include <linux/autoconf.h> |
51533b61 | 12 | #include <asm-generic/vmlinux.lds.h> |
baa69b12 JN |
13 | #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 | |
51533b61 | 20 | |
c5ec6fb0 | 21 | |
51533b61 MS |
22 | jiffies = jiffies_64; |
23 | SECTIONS | |
24 | { | |
25 | . = DRAM_VIRTUAL_BASE; | |
26 | dram_start = .; | |
c5ec6fb0 JN |
27 | #ifdef CONFIG_ETRAX_ARCH_V10 |
28 | ibr_start = .; | |
29 | #else | |
51533b61 | 30 | ebp_start = .; |
baa69b12 JN |
31 | /* The boot section is only necessary until the VCS top */ |
32 | /* level testbench includes both flash and DRAM. */ | |
51533b61 | 33 | .boot : { *(.boot) } |
c5ec6fb0 | 34 | #endif |
51533b61 | 35 | |
c5ec6fb0 | 36 | /* see head.S and pages reserved at the start */ |
baa69b12 | 37 | . = DRAM_VIRTUAL_BASE + 0x4000; |
51533b61 | 38 | |
c5ec6fb0 JN |
39 | _text = .; /* Text and read-only data. */ |
40 | text_start = .; /* Lots of aliases. */ | |
51533b61 MS |
41 | _stext = .; |
42 | __stext = .; | |
43 | .text : { | |
baa69b12 | 44 | TEXT_TEXT |
51533b61 MS |
45 | SCHED_TEXT |
46 | LOCK_TEXT | |
47 | *(.fixup) | |
48 | *(.text.__*) | |
49 | } | |
50 | ||
c5ec6fb0 | 51 | _etext = . ; /* End of text section. */ |
51533b61 MS |
52 | __etext = .; |
53 | ||
24924ece | 54 | EXCEPTION_TABLE(4) |
51533b61 MS |
55 | |
56 | RODATA | |
57 | ||
58 | . = ALIGN (4); | |
59 | ___data_start = . ; | |
60 | __Sdata = . ; | |
c5ec6fb0 | 61 | .data : { /* Data */ |
5c617c6f | 62 | DATA_DATA |
51533b61 | 63 | } |
c5ec6fb0 | 64 | __edata = . ; /* End of data section. */ |
51533b61 MS |
65 | _edata = . ; |
66 | ||
24924ece | 67 | INIT_TASK_DATA_SECTION(PAGE_SIZE) |
51533b61 | 68 | |
c5ec6fb0 | 69 | . = ALIGN(PAGE_SIZE); /* Init code and data. */ |
baa69b12 | 70 | __init_begin = .; |
24924ece | 71 | INIT_TEXT_SECTION(PAGE_SIZE) |
01ba2bdc | 72 | .init.data : { INIT_DATA } |
24924ece | 73 | .init.setup : { INIT_SETUP(16) } |
c5ec6fb0 | 74 | #ifdef CONFIG_ETRAX_ARCH_V32 |
51533b61 MS |
75 | __start___param = .; |
76 | __param : { *(__param) } | |
77 | __stop___param = .; | |
c5ec6fb0 | 78 | #endif |
baa69b12 | 79 | .initcall.init : { |
24924ece | 80 | INIT_CALLS |
51533b61 MS |
81 | } |
82 | ||
83 | .con_initcall.init : { | |
24924ece | 84 | CON_INITCALL |
51533b61 MS |
85 | } |
86 | SECURITY_INIT | |
87 | ||
c5ec6fb0 JN |
88 | #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 | |
baa69b12 | 99 | PERCPU(PAGE_SIZE) |
51533b61 MS |
100 | |
101 | .init.ramfs : { | |
24924ece | 102 | INIT_RAM_FS |
51533b61 | 103 | } |
c5ec6fb0 | 104 | #endif |
51533b61 | 105 | |
baa69b12 JN |
106 | /* |
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 | */ | |
c5ec6fb0 | 111 | . = ALIGN(PAGE_SIZE); |
baa69b12 JN |
112 | |
113 | __init_end = .; | |
51533b61 | 114 | |
c5ec6fb0 | 115 | __data_end = . ; /* Move to _edata ? */ |
24924ece | 116 | BSS_SECTION(0, 0, 0) |
51533b61 MS |
117 | |
118 | . = ALIGN (0x20); | |
119 | _end = .; | |
120 | __end = .; | |
121 | ||
122 | /* Sections to be discarded */ | |
baa69b12 | 123 | /DISCARD/ : { |
01ba2bdc SR |
124 | EXIT_TEXT |
125 | EXIT_DATA | |
51533b61 MS |
126 | *(.exitcall.exit) |
127 | } | |
128 | ||
baa69b12 | 129 | dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024; |
51533b61 | 130 | } |