Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * vmlinux.lds.S -- master linker script for m68knommu arch |
| 3 | * |
Greg Ungerer | 73e2fba | 2006-06-26 16:33:05 +1000 | [diff] [blame] | 4 | * (C) Copyright 2002-2006, Greg Ungerer <gerg@snapgear.com> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * |
Greg Ungerer | 1c952af | 2006-06-28 16:44:14 +1000 | [diff] [blame] | 6 | * This linker script is equiped to build either ROM loaded or RAM |
| 7 | * run kernels. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | */ |
| 9 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <asm-generic/vmlinux.lds.h> |
| 11 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #if defined(CONFIG_RAMKERNEL) |
Greg Ungerer | 73e2fba | 2006-06-26 16:33:05 +1000 | [diff] [blame] | 13 | #define RAM_START CONFIG_KERNELBASE |
| 14 | #define RAM_LENGTH (CONFIG_RAMBASE + CONFIG_RAMSIZE - CONFIG_KERNELBASE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | #define TEXT ram |
| 16 | #define DATA ram |
| 17 | #define INIT ram |
| 18 | #define BSS ram |
| 19 | #endif |
| 20 | #if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL) |
Greg Ungerer | 73e2fba | 2006-06-26 16:33:05 +1000 | [diff] [blame] | 21 | #define RAM_START CONFIG_RAMBASE |
| 22 | #define RAM_LENGTH CONFIG_RAMSIZE |
Greg Ungerer | 1c952af | 2006-06-28 16:44:14 +1000 | [diff] [blame] | 23 | #define ROMVEC_START CONFIG_ROMVEC |
| 24 | #define ROMVEC_LENGTH CONFIG_ROMVECSIZE |
| 25 | #define ROM_START CONFIG_ROMSTART |
| 26 | #define ROM_LENGTH CONFIG_ROMSIZE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | #define TEXT rom |
| 28 | #define DATA ram |
| 29 | #define INIT ram |
| 30 | #define BSS ram |
| 31 | #endif |
| 32 | |
| 33 | #ifndef DATA_ADDR |
| 34 | #define DATA_ADDR |
| 35 | #endif |
| 36 | |
| 37 | |
| 38 | OUTPUT_ARCH(m68k) |
| 39 | ENTRY(_start) |
| 40 | |
| 41 | MEMORY { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | ram : ORIGIN = RAM_START, LENGTH = RAM_LENGTH |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | #ifdef ROM_START |
| 44 | romvec : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH |
| 45 | rom : ORIGIN = ROM_START, LENGTH = ROM_LENGTH |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | #endif |
| 47 | } |
| 48 | |
| 49 | jiffies = jiffies_64 + 4; |
| 50 | |
| 51 | SECTIONS { |
| 52 | |
| 53 | #ifdef ROMVEC_START |
| 54 | . = ROMVEC_START ; |
| 55 | .romvec : { |
| 56 | __rom_start = . ; |
| 57 | _romvec = .; |
| 58 | *(.data.initvect) |
| 59 | } > romvec |
| 60 | #endif |
| 61 | |
| 62 | .text : { |
Eric W. Biederman | fd593d1 | 2006-12-07 02:14:04 +0100 | [diff] [blame] | 63 | _text = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | _stext = . ; |
Greg Ungerer | 9b0e741 | 2008-07-11 15:29:36 +1000 | [diff] [blame] | 65 | HEAD_TEXT |
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 66 | TEXT_TEXT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | SCHED_TEXT |
Sebastian Siewior | 779125c | 2008-05-01 12:16:46 +1000 | [diff] [blame] | 68 | LOCK_TEXT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | *(.text.lock) |
| 70 | |
| 71 | . = ALIGN(16); /* Exception table */ |
| 72 | __start___ex_table = .; |
| 73 | *(__ex_table) |
| 74 | __stop___ex_table = .; |
| 75 | |
| 76 | *(.rodata) *(.rodata.*) |
| 77 | *(__vermagic) /* Kernel version magic */ |
Sebastian Siewior | 779125c | 2008-05-01 12:16:46 +1000 | [diff] [blame] | 78 | *(__markers_strings) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | *(.rodata1) |
| 80 | *(.rodata.str1.1) |
| 81 | |
| 82 | /* Kernel symbol table: Normal symbols */ |
| 83 | . = ALIGN(4); |
| 84 | __start___ksymtab = .; |
| 85 | *(__ksymtab) |
| 86 | __stop___ksymtab = .; |
| 87 | |
| 88 | /* Kernel symbol table: GPL-only symbols */ |
| 89 | __start___ksymtab_gpl = .; |
| 90 | *(__ksymtab_gpl) |
| 91 | __stop___ksymtab_gpl = .; |
| 92 | |
Greg Ungerer | 56591b9 | 2007-02-07 11:45:43 +1000 | [diff] [blame] | 93 | /* Kernel symbol table: Normal unused symbols */ |
| 94 | __start___ksymtab_unused = .; |
| 95 | *(__ksymtab_unused) |
| 96 | __stop___ksymtab_unused = .; |
| 97 | |
| 98 | /* Kernel symbol table: GPL-only unused symbols */ |
| 99 | __start___ksymtab_unused_gpl = .; |
| 100 | *(__ksymtab_unused_gpl) |
| 101 | __stop___ksymtab_unused_gpl = .; |
| 102 | |
Greg Kroah-Hartman | 9f28bb7 | 2006-03-20 13:17:13 -0800 | [diff] [blame] | 103 | /* Kernel symbol table: GPL-future symbols */ |
| 104 | __start___ksymtab_gpl_future = .; |
| 105 | *(__ksymtab_gpl_future) |
| 106 | __stop___ksymtab_gpl_future = .; |
| 107 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | /* Kernel symbol table: Normal symbols */ |
| 109 | __start___kcrctab = .; |
| 110 | *(__kcrctab) |
| 111 | __stop___kcrctab = .; |
| 112 | |
| 113 | /* Kernel symbol table: GPL-only symbols */ |
| 114 | __start___kcrctab_gpl = .; |
| 115 | *(__kcrctab_gpl) |
| 116 | __stop___kcrctab_gpl = .; |
| 117 | |
Greg Ungerer | f38c843 | 2008-05-12 14:02:23 -0700 | [diff] [blame] | 118 | /* Kernel symbol table: Normal unused symbols */ |
| 119 | __start___kcrctab_unused = .; |
| 120 | *(__kcrctab_unused) |
| 121 | __stop___kcrctab_unused = .; |
| 122 | |
| 123 | /* Kernel symbol table: GPL-only unused symbols */ |
| 124 | __start___kcrctab_unused_gpl = .; |
| 125 | *(__kcrctab_unused_gpl) |
| 126 | __stop___kcrctab_unused_gpl = .; |
| 127 | |
Greg Kroah-Hartman | 9f28bb7 | 2006-03-20 13:17:13 -0800 | [diff] [blame] | 128 | /* Kernel symbol table: GPL-future symbols */ |
| 129 | __start___kcrctab_gpl_future = .; |
| 130 | *(__kcrctab_gpl_future) |
| 131 | __stop___kcrctab_gpl_future = .; |
| 132 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 133 | /* Kernel symbol table: strings */ |
| 134 | *(__ksymtab_strings) |
| 135 | |
| 136 | /* Built-in module parameters */ |
Greg Ungerer | 124df2d | 2005-11-07 14:09:50 +1000 | [diff] [blame] | 137 | . = ALIGN(4) ; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 138 | __start___param = .; |
| 139 | *(__param) |
| 140 | __stop___param = .; |
| 141 | |
| 142 | . = ALIGN(4) ; |
| 143 | _etext = . ; |
| 144 | } > TEXT |
| 145 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 146 | .data DATA_ADDR : { |
| 147 | . = ALIGN(4); |
| 148 | _sdata = . ; |
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 149 | DATA_DATA |
Greg Ungerer | a14f5e4 | 2009-04-17 22:55:06 +1000 | [diff] [blame] | 150 | . = ALIGN(32); |
| 151 | *(.data.cacheline_aligned) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | . = ALIGN(8192) ; |
| 153 | *(.data.init_task) |
| 154 | _edata = . ; |
| 155 | } > DATA |
| 156 | |
| 157 | .init : { |
| 158 | . = ALIGN(4096); |
| 159 | __init_begin = .; |
| 160 | _sinittext = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 161 | INIT_TEXT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | _einittext = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 163 | INIT_DATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 164 | . = ALIGN(16); |
| 165 | __setup_start = .; |
| 166 | *(.init.setup) |
| 167 | __setup_end = .; |
| 168 | __initcall_start = .; |
Andrew Morton | 61ce1ef | 2006-10-27 11:41:44 -0700 | [diff] [blame] | 169 | INITCALLS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 170 | __initcall_end = .; |
| 171 | __con_initcall_start = .; |
| 172 | *(.con_initcall.init) |
| 173 | __con_initcall_end = .; |
| 174 | __security_initcall_start = .; |
| 175 | *(.security_initcall.init) |
| 176 | __security_initcall_end = .; |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 177 | #ifdef CONFIG_BLK_DEV_INITRD |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | . = ALIGN(4); |
| 179 | __initramfs_start = .; |
| 180 | *(.init.ramfs) |
| 181 | __initramfs_end = .; |
Jean-Paul Saman | 67d3822 | 2007-02-10 01:44:44 -0800 | [diff] [blame] | 182 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 183 | . = ALIGN(4096); |
| 184 | __init_end = .; |
| 185 | } > INIT |
| 186 | |
| 187 | /DISCARD/ : { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 188 | EXIT_TEXT |
| 189 | EXIT_DATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 190 | *(.exitcall.exit) |
| 191 | } |
| 192 | |
| 193 | .bss : { |
| 194 | . = ALIGN(4); |
| 195 | _sbss = . ; |
| 196 | *(.bss) |
| 197 | *(COMMON) |
| 198 | . = ALIGN(4) ; |
| 199 | _ebss = . ; |
Sebastian Siewior | 779125c | 2008-05-01 12:16:46 +1000 | [diff] [blame] | 200 | _end = . ; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | } > BSS |
| 202 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 203 | } |
| 204 | |