Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 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 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 11 | #include <linux/autoconf.h> |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 12 | #include <asm-generic/vmlinux.lds.h> |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 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 |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 20 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 21 | |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 22 | jiffies = jiffies_64; |
| 23 | SECTIONS |
| 24 | { |
| 25 | . = DRAM_VIRTUAL_BASE; |
| 26 | dram_start = .; |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 27 | #ifdef CONFIG_ETRAX_ARCH_V10 |
| 28 | ibr_start = .; |
| 29 | #else |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 30 | ebp_start = .; |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 31 | /* The boot section is only necessary until the VCS top */ |
| 32 | /* level testbench includes both flash and DRAM. */ |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 33 | .boot : { *(.boot) } |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 34 | #endif |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 35 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 36 | /* see head.S and pages reserved at the start */ |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 37 | . = DRAM_VIRTUAL_BASE + 0x4000; |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 38 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 39 | _text = .; /* Text and read-only data. */ |
| 40 | text_start = .; /* Lots of aliases. */ |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 41 | _stext = .; |
| 42 | __stext = .; |
| 43 | .text : { |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 44 | TEXT_TEXT |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 45 | SCHED_TEXT |
| 46 | LOCK_TEXT |
| 47 | *(.fixup) |
| 48 | *(.text.__*) |
| 49 | } |
| 50 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 51 | _etext = . ; /* End of text section. */ |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 52 | __etext = .; |
| 53 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 54 | . = ALIGN(4); /* Exception table. */ |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 55 | __start___ex_table = .; |
| 56 | __ex_table : { *(__ex_table) } |
| 57 | __stop___ex_table = .; |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 58 | |
| 59 | RODATA |
| 60 | |
| 61 | . = ALIGN (4); |
| 62 | ___data_start = . ; |
| 63 | __Sdata = . ; |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 64 | .data : { /* Data */ |
Mathieu Desnoyers | 5c617c6 | 2007-06-16 22:28:26 -0400 | [diff] [blame] | 65 | DATA_DATA |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 66 | } |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 67 | __edata = . ; /* End of data section. */ |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 68 | _edata = . ; |
| 69 | |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 70 | . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned. */ |
| 71 | .data.init_task : { *(.data.init_task) } |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 72 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 73 | . = ALIGN(PAGE_SIZE); /* Init code and data. */ |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 74 | __init_begin = .; |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 75 | .init.text : { |
| 76 | _sinittext = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 77 | INIT_TEXT |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 78 | _einittext = .; |
| 79 | } |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 80 | .init.data : { INIT_DATA } |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 81 | . = ALIGN(16); |
| 82 | __setup_start = .; |
| 83 | .init.setup : { *(.init.setup) } |
| 84 | __setup_end = .; |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 85 | #ifdef CONFIG_ETRAX_ARCH_V32 |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 86 | __start___param = .; |
| 87 | __param : { *(__param) } |
| 88 | __stop___param = .; |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 89 | #endif |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 90 | .initcall.init : { |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 91 | __initcall_start = .; |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 92 | INITCALLS |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 93 | __initcall_end = .; |
| 94 | } |
| 95 | |
| 96 | .con_initcall.init : { |
| 97 | __con_initcall_start = .; |
| 98 | *(.con_initcall.init) |
| 99 | __con_initcall_end = .; |
| 100 | } |
| 101 | SECURITY_INIT |
| 102 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 103 | #ifdef CONFIG_ETRAX_ARCH_V10 |
| 104 | #ifdef CONFIG_BLK_DEV_INITRD |
| 105 | .init.ramfs : { |
| 106 | __initramfs_start = .; |
| 107 | *(.init.ramfs) |
| 108 | __initramfs_end = .; |
| 109 | } |
| 110 | #endif |
| 111 | #endif |
| 112 | __vmlinux_end = .; /* Last address of the physical file. */ |
| 113 | #ifdef CONFIG_ETRAX_ARCH_V32 |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 114 | PERCPU(PAGE_SIZE) |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 115 | |
| 116 | .init.ramfs : { |
| 117 | __initramfs_start = .; |
| 118 | *(.init.ramfs) |
| 119 | __initramfs_end = .; |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 120 | } |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 121 | #endif |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 122 | |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 123 | /* |
| 124 | * We fill to the next page, so we can discard all init |
| 125 | * pages without needing to consider what payload might be |
| 126 | * appended to the kernel image. |
| 127 | */ |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 128 | . = ALIGN(PAGE_SIZE); |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 129 | |
| 130 | __init_end = .; |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 131 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 132 | __data_end = . ; /* Move to _edata ? */ |
| 133 | __bss_start = .; /* BSS. */ |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 134 | .bss : { |
| 135 | *(COMMON) |
| 136 | *(.bss) |
| 137 | } |
| 138 | |
| 139 | . = ALIGN (0x20); |
| 140 | _end = .; |
| 141 | __end = .; |
| 142 | |
| 143 | /* Sections to be discarded */ |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 144 | /DISCARD/ : { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 145 | EXIT_TEXT |
| 146 | EXIT_DATA |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 147 | *(.exitcall.exit) |
| 148 | } |
| 149 | |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 150 | dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024; |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 151 | } |