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 | |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 11 | #include <asm-generic/vmlinux.lds.h> |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 12 | #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 Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 19 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 20 | |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 21 | jiffies = jiffies_64; |
| 22 | SECTIONS |
| 23 | { |
| 24 | . = DRAM_VIRTUAL_BASE; |
| 25 | dram_start = .; |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 26 | #ifdef CONFIG_ETRAX_ARCH_V10 |
| 27 | ibr_start = .; |
| 28 | #else |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 29 | ebp_start = .; |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 30 | /* The boot section is only necessary until the VCS top */ |
| 31 | /* level testbench includes both flash and DRAM. */ |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 32 | .boot : { *(.boot) } |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 33 | #endif |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 34 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 35 | /* see head.S and pages reserved at the start */ |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 36 | . = DRAM_VIRTUAL_BASE + 0x4000; |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 37 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 38 | _text = .; /* Text and read-only data. */ |
| 39 | text_start = .; /* Lots of aliases. */ |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 40 | _stext = .; |
| 41 | __stext = .; |
| 42 | .text : { |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 43 | TEXT_TEXT |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 44 | SCHED_TEXT |
| 45 | LOCK_TEXT |
| 46 | *(.fixup) |
| 47 | *(.text.__*) |
| 48 | } |
| 49 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 50 | _etext = . ; /* End of text section. */ |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 51 | __etext = .; |
| 52 | |
Jesper Nilsson | 24924ec | 2009-09-23 13:21:57 +0200 | [diff] [blame] | 53 | EXCEPTION_TABLE(4) |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 54 | |
Jesper Nilsson | 473e162 | 2011-10-24 11:19:25 +0200 | [diff] [blame] | 55 | _sdata = .; |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 56 | RODATA |
| 57 | |
| 58 | . = ALIGN (4); |
| 59 | ___data_start = . ; |
| 60 | __Sdata = . ; |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 61 | .data : { /* Data */ |
Jesper Nilsson | dcb313c | 2010-08-04 14:01:28 +0200 | [diff] [blame] | 62 | CACHELINE_ALIGNED_DATA(32) |
| 63 | READ_MOSTLY_DATA(32) |
Mathieu Desnoyers | 5c617c6 | 2007-06-16 22:28:26 -0400 | [diff] [blame] | 64 | DATA_DATA |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 65 | } |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 66 | __edata = . ; /* End of data section. */ |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 67 | _edata = . ; |
| 68 | |
Jesper Nilsson | 24924ec | 2009-09-23 13:21:57 +0200 | [diff] [blame] | 69 | INIT_TASK_DATA_SECTION(PAGE_SIZE) |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 70 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 71 | . = ALIGN(PAGE_SIZE); /* Init code and data. */ |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 72 | __init_begin = .; |
Jesper Nilsson | 24924ec | 2009-09-23 13:21:57 +0200 | [diff] [blame] | 73 | INIT_TEXT_SECTION(PAGE_SIZE) |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 74 | .init.data : { INIT_DATA } |
Jesper Nilsson | 24924ec | 2009-09-23 13:21:57 +0200 | [diff] [blame] | 75 | .init.setup : { INIT_SETUP(16) } |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 76 | .initcall.init : { |
Jesper Nilsson | 24924ec | 2009-09-23 13:21:57 +0200 | [diff] [blame] | 77 | INIT_CALLS |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 78 | } |
| 79 | |
| 80 | .con_initcall.init : { |
Jesper Nilsson | 24924ec | 2009-09-23 13:21:57 +0200 | [diff] [blame] | 81 | CON_INITCALL |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 82 | } |
| 83 | SECURITY_INIT |
| 84 | |
Jesper Nilsson | 7c8a25b | 2010-08-04 14:10:04 +0200 | [diff] [blame] | 85 | /* .exit.text is discarded at runtime, not link time, |
| 86 | * to deal with references from __bug_table |
| 87 | */ |
| 88 | .exit.text : { |
| 89 | EXIT_TEXT |
| 90 | } |
| 91 | .exit.data : { |
| 92 | EXIT_DATA |
| 93 | } |
| 94 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 95 | #ifdef CONFIG_ETRAX_ARCH_V10 |
| 96 | #ifdef CONFIG_BLK_DEV_INITRD |
| 97 | .init.ramfs : { |
| 98 | __initramfs_start = .; |
| 99 | *(.init.ramfs) |
| 100 | __initramfs_end = .; |
| 101 | } |
| 102 | #endif |
| 103 | #endif |
| 104 | __vmlinux_end = .; /* Last address of the physical file. */ |
| 105 | #ifdef CONFIG_ETRAX_ARCH_V32 |
Tejun Heo | 0415b00d1 | 2011-03-24 18:50:09 +0100 | [diff] [blame] | 106 | PERCPU_SECTION(32) |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 107 | |
| 108 | .init.ramfs : { |
Jesper Nilsson | 24924ec | 2009-09-23 13:21:57 +0200 | [diff] [blame] | 109 | INIT_RAM_FS |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 110 | } |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 111 | #endif |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 112 | |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 113 | /* |
| 114 | * We fill to the next page, so we can discard all init |
| 115 | * pages without needing to consider what payload might be |
| 116 | * appended to the kernel image. |
| 117 | */ |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 118 | . = ALIGN(PAGE_SIZE); |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 119 | |
| 120 | __init_end = .; |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 121 | |
Jesper Nilsson | c5ec6fb | 2008-10-22 23:57:53 +0200 | [diff] [blame] | 122 | __data_end = . ; /* Move to _edata ? */ |
Jesper Nilsson | 85d9865 | 2010-08-04 18:30:01 +0200 | [diff] [blame] | 123 | BSS_SECTION(1, 1, 1) |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 124 | |
| 125 | . = ALIGN (0x20); |
| 126 | _end = .; |
| 127 | __end = .; |
| 128 | |
Jesper Nilsson | baa69b1 | 2008-01-30 12:57:31 +0100 | [diff] [blame] | 129 | dram_end = dram_start + (CONFIG_ETRAX_DRAM_SIZE - __CONFIG_ETRAX_VMEM_SIZE)*1024*1024; |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 130 | |
| 131 | DISCARDS |
Mikael Starvik | 51533b6 | 2005-07-27 11:44:44 -0700 | [diff] [blame] | 132 | } |