]>
Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
51533b61 MS |
2 | /* ld script to make the Linux/CRIS kernel |
3 | * Authors: Bjorn Wesen (bjornw@axis.com) | |
4 | * | |
5 | * It is VERY DANGEROUS to fiddle around with the symbols in this | |
6 | * script. It is for example quite vital that all generated sections | |
7 | * that are used are actually named here, otherwise the linker will | |
8 | * put them at the end, where the init stuff is which is FREED after | |
9 | * the kernel has booted. | |
10 | */ | |
11 | ||
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 : { | |
f9f3f864 | 44 | HEAD_TEXT |
baa69b12 | 45 | TEXT_TEXT |
51533b61 | 46 | SCHED_TEXT |
6727ad9e | 47 | CPUIDLE_TEXT |
51533b61 MS |
48 | LOCK_TEXT |
49 | *(.fixup) | |
50 | *(.text.__*) | |
51 | } | |
52 | ||
c5ec6fb0 | 53 | _etext = . ; /* End of text section. */ |
51533b61 MS |
54 | __etext = .; |
55 | ||
24924ece | 56 | EXCEPTION_TABLE(4) |
51533b61 | 57 | |
473e162e | 58 | _sdata = .; |
51533b61 MS |
59 | RODATA |
60 | ||
61 | . = ALIGN (4); | |
62 | ___data_start = . ; | |
63 | __Sdata = . ; | |
c5ec6fb0 | 64 | .data : { /* Data */ |
dcb313c2 JN |
65 | CACHELINE_ALIGNED_DATA(32) |
66 | READ_MOSTLY_DATA(32) | |
5c617c6f | 67 | DATA_DATA |
51533b61 | 68 | } |
c5ec6fb0 | 69 | __edata = . ; /* End of data section. */ |
51533b61 MS |
70 | _edata = . ; |
71 | ||
b5effd38 PZ |
72 | BUG_TABLE |
73 | ||
24924ece | 74 | INIT_TASK_DATA_SECTION(PAGE_SIZE) |
51533b61 | 75 | |
c5ec6fb0 | 76 | . = ALIGN(PAGE_SIZE); /* Init code and data. */ |
baa69b12 | 77 | __init_begin = .; |
24924ece | 78 | INIT_TEXT_SECTION(PAGE_SIZE) |
01ba2bdc | 79 | .init.data : { INIT_DATA } |
24924ece | 80 | .init.setup : { INIT_SETUP(16) } |
baa69b12 | 81 | .initcall.init : { |
24924ece | 82 | INIT_CALLS |
51533b61 MS |
83 | } |
84 | ||
85 | .con_initcall.init : { | |
24924ece | 86 | CON_INITCALL |
51533b61 MS |
87 | } |
88 | SECURITY_INIT | |
89 | ||
7c8a25b5 JN |
90 | /* .exit.text is discarded at runtime, not link time, |
91 | * to deal with references from __bug_table | |
92 | */ | |
93 | .exit.text : { | |
94 | EXIT_TEXT | |
95 | } | |
96 | .exit.data : { | |
97 | EXIT_DATA | |
98 | } | |
99 | ||
c5ec6fb0 JN |
100 | #ifdef CONFIG_ETRAX_ARCH_V10 |
101 | #ifdef CONFIG_BLK_DEV_INITRD | |
102 | .init.ramfs : { | |
103 | __initramfs_start = .; | |
104 | *(.init.ramfs) | |
105 | __initramfs_end = .; | |
106 | } | |
107 | #endif | |
108 | #endif | |
109 | __vmlinux_end = .; /* Last address of the physical file. */ | |
110 | #ifdef CONFIG_ETRAX_ARCH_V32 | |
0415b00d | 111 | PERCPU_SECTION(32) |
51533b61 MS |
112 | |
113 | .init.ramfs : { | |
24924ece | 114 | INIT_RAM_FS |
51533b61 | 115 | } |
c5ec6fb0 | 116 | #endif |
51533b61 | 117 | |
baa69b12 JN |
118 | /* |
119 | * We fill to the next page, so we can discard all init | |
120 | * pages without needing to consider what payload might be | |
121 | * appended to the kernel image. | |
122 | */ | |
c5ec6fb0 | 123 | . = ALIGN(PAGE_SIZE); |
baa69b12 JN |
124 | |
125 | __init_end = .; | |
51533b61 | 126 | |
c5ec6fb0 | 127 | __data_end = . ; /* Move to _edata ? */ |
85d98657 | 128 | BSS_SECTION(1, 1, 1) |
51533b61 MS |
129 | |
130 | . = ALIGN (0x20); | |
131 | _end = .; | |
132 | __end = .; | |
133 | ||
baa69b12 | 134 | dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024; |
023bf6f1 TH |
135 | |
136 | DISCARDS | |
51533b61 | 137 | } |