David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 1 | /* MN10300 Main kernel linker script |
| 2 | * |
| 3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. |
| 4 | * Written by David Howells (dhowells@redhat.com) |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public Licence |
| 8 | * as published by the Free Software Foundation; either version |
| 9 | * 2 of the Licence, or (at your option) any later version. |
| 10 | */ |
| 11 | #define __VMLINUX_LDS__ |
| 12 | #include <asm-generic/vmlinux.lds.h> |
| 13 | #include <asm/thread_info.h> |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame^] | 14 | #include <asm/page.h> |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 15 | |
| 16 | OUTPUT_FORMAT("elf32-am33lin", "elf32-am33lin", "elf32-am33lin") |
| 17 | OUTPUT_ARCH(mn10300) |
| 18 | ENTRY(_start) |
| 19 | jiffies = jiffies_64; |
| 20 | #ifndef CONFIG_MN10300_CURRENT_IN_E2 |
| 21 | current = __current; |
| 22 | #endif |
| 23 | SECTIONS |
| 24 | { |
| 25 | . = CONFIG_KERNEL_TEXT_ADDRESS; |
| 26 | /* read-only */ |
| 27 | _stext = .; |
| 28 | _text = .; /* Text and read-only data */ |
| 29 | .text : { |
| 30 | *( |
| 31 | .text.head |
| 32 | .text |
| 33 | ) |
| 34 | TEXT_TEXT |
| 35 | SCHED_TEXT |
| 36 | LOCK_TEXT |
| 37 | KPROBES_TEXT |
| 38 | *(.fixup) |
| 39 | *(.gnu.warning) |
| 40 | } = 0xcb |
| 41 | |
| 42 | _etext = .; /* End of text section */ |
| 43 | |
| 44 | . = ALIGN(16); /* Exception table */ |
| 45 | __start___ex_table = .; |
| 46 | __ex_table : { *(__ex_table) } |
| 47 | __stop___ex_table = .; |
| 48 | |
| 49 | BUG_TABLE |
| 50 | |
| 51 | RODATA |
| 52 | |
| 53 | /* writeable */ |
| 54 | .data : { /* Data */ |
| 55 | DATA_DATA |
| 56 | CONSTRUCTORS |
| 57 | } |
| 58 | |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame^] | 59 | . = ALIGN(PAGE_SIZE); |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 60 | __nosave_begin = .; |
| 61 | .data_nosave : { *(.data.nosave) } |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame^] | 62 | . = ALIGN(PAGE_SIZE); |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 63 | __nosave_end = .; |
| 64 | |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame^] | 65 | . = ALIGN(PAGE_SIZE); |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 66 | .data.page_aligned : { *(.data.idt) } |
| 67 | |
| 68 | . = ALIGN(32); |
| 69 | .data.cacheline_aligned : { *(.data.cacheline_aligned) } |
| 70 | |
| 71 | /* rarely changed data like cpu maps */ |
| 72 | . = ALIGN(32); |
| 73 | .data.read_mostly : AT(ADDR(.data.read_mostly)) { |
| 74 | *(.data.read_mostly) |
| 75 | _edata = .; /* End of data section */ |
| 76 | } |
| 77 | |
| 78 | . = ALIGN(THREAD_SIZE); /* init_task */ |
| 79 | .data.init_task : { *(.data.init_task) } |
| 80 | |
| 81 | /* might get freed after init */ |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame^] | 82 | . = ALIGN(PAGE_SIZE); |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 83 | .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { |
| 84 | __smp_locks = .; |
| 85 | *(.smp_locks) |
| 86 | __smp_locks_end = .; |
| 87 | } |
| 88 | |
| 89 | /* will be freed after init */ |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame^] | 90 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 91 | __init_begin = .; |
| 92 | .init.text : { |
| 93 | _sinittext = .; |
| 94 | *(.init.text) |
| 95 | _einittext = .; |
| 96 | } |
| 97 | .init.data : { *(.init.data) } |
| 98 | . = ALIGN(16); |
| 99 | __setup_start = .; |
| 100 | .setup.init : { KEEP(*(.init.setup)) } |
| 101 | __setup_end = .; |
| 102 | |
| 103 | __initcall_start = .; |
| 104 | .initcall.init : { |
| 105 | INITCALLS |
| 106 | } |
| 107 | __initcall_end = .; |
| 108 | __con_initcall_start = .; |
| 109 | .con_initcall.init : { *(.con_initcall.init) } |
| 110 | __con_initcall_end = .; |
| 111 | |
| 112 | SECURITY_INIT |
| 113 | . = ALIGN(4); |
| 114 | __alt_instructions = .; |
| 115 | .altinstructions : { *(.altinstructions) } |
| 116 | __alt_instructions_end = .; |
| 117 | .altinstr_replacement : { *(.altinstr_replacement) } |
| 118 | /* .exit.text is discard at runtime, not link time, to deal with references |
| 119 | from .altinstructions and .eh_frame */ |
| 120 | .exit.text : { *(.exit.text) } |
| 121 | .exit.data : { *(.exit.data) } |
| 122 | |
| 123 | #ifdef CONFIG_BLK_DEV_INITRD |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame^] | 124 | . = ALIGN(PAGE_SIZE); |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 125 | __initramfs_start = .; |
| 126 | .init.ramfs : { *(.init.ramfs) } |
| 127 | __initramfs_end = .; |
| 128 | #endif |
| 129 | |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame^] | 130 | PERCPU(32) |
| 131 | . = ALIGN(PAGE_SIZE); |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 132 | __init_end = .; |
| 133 | /* freed after init ends here */ |
| 134 | |
| 135 | __bss_start = .; /* BSS */ |
| 136 | .bss : { |
| 137 | *(.bss.page_aligned) |
| 138 | *(.bss) |
| 139 | } |
| 140 | . = ALIGN(4); |
| 141 | __bss_stop = .; |
| 142 | |
| 143 | _end = . ; |
| 144 | |
| 145 | /* This is where the kernel creates the early boot page tables */ |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame^] | 146 | . = ALIGN(PAGE_SIZE); |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 147 | pg0 = .; |
| 148 | |
| 149 | /* Sections to be discarded */ |
| 150 | /DISCARD/ : { |
| 151 | *(.exitcall.exit) |
| 152 | } |
| 153 | |
| 154 | STABS_DEBUG |
| 155 | |
| 156 | DWARF_DEBUG |
| 157 | } |