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 : { |
Tim Abbott | 9760f8f | 2009-04-25 22:11:04 -0400 | [diff] [blame] | 30 | HEAD_TEXT |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 31 | TEXT_TEXT |
| 32 | SCHED_TEXT |
| 33 | LOCK_TEXT |
| 34 | KPROBES_TEXT |
| 35 | *(.fixup) |
| 36 | *(.gnu.warning) |
| 37 | } = 0xcb |
| 38 | |
| 39 | _etext = .; /* End of text section */ |
| 40 | |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 41 | EXCEPTION_TABLE(16) |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 42 | BUG_TABLE |
| 43 | |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 44 | RO_DATA(PAGE_SIZE) |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 45 | |
| 46 | /* writeable */ |
| 47 | .data : { /* Data */ |
| 48 | DATA_DATA |
| 49 | CONSTRUCTORS |
| 50 | } |
| 51 | |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 52 | .data_nosave : { NOSAVE_DATA; } |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 53 | |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 54 | .data.page_aligned : { PAGE_ALIGNED_DATA(PAGE_SIZE); } |
| 55 | .data.cacheline_aligned : { CACHELINE_ALIGNED_DATA(32); } |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 56 | |
| 57 | /* rarely changed data like cpu maps */ |
| 58 | . = ALIGN(32); |
| 59 | .data.read_mostly : AT(ADDR(.data.read_mostly)) { |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 60 | READ_MOSTLY_DATA(32); |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 61 | _edata = .; /* End of data section */ |
| 62 | } |
| 63 | |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 64 | .data.init_task : { INIT_TASK(THREAD_SIZE); } |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 65 | |
| 66 | /* might get freed after init */ |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame] | 67 | . = ALIGN(PAGE_SIZE); |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 68 | .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) { |
| 69 | __smp_locks = .; |
| 70 | *(.smp_locks) |
| 71 | __smp_locks_end = .; |
| 72 | } |
| 73 | |
| 74 | /* will be freed after init */ |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame] | 75 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 76 | __init_begin = .; |
| 77 | .init.text : { |
| 78 | _sinittext = .; |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 79 | INIT_TEXT; |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 80 | _einittext = .; |
| 81 | } |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 82 | .init.data : { INIT_DATA; } |
| 83 | .setup.init : { INIT_SETUP(16); } |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 84 | |
| 85 | __initcall_start = .; |
| 86 | .initcall.init : { |
| 87 | INITCALLS |
| 88 | } |
| 89 | __initcall_end = .; |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 90 | .con_initcall.init : { CON_INITCALL; } |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 91 | |
| 92 | SECURITY_INIT |
| 93 | . = ALIGN(4); |
| 94 | __alt_instructions = .; |
| 95 | .altinstructions : { *(.altinstructions) } |
| 96 | __alt_instructions_end = .; |
| 97 | .altinstr_replacement : { *(.altinstr_replacement) } |
| 98 | /* .exit.text is discard at runtime, not link time, to deal with references |
| 99 | from .altinstructions and .eh_frame */ |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 100 | .exit.text : { EXIT_TEXT; } |
| 101 | .exit.data : { EXIT_DATA; } |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 102 | |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 103 | .init.ramfs : { INIT_RAM_FS; } |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 104 | |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame] | 105 | PERCPU(32) |
| 106 | . = ALIGN(PAGE_SIZE); |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 107 | __init_end = .; |
| 108 | /* freed after init ends here */ |
| 109 | |
David Howells | 2e8b5a0 | 2009-06-22 15:32:36 +0100 | [diff] [blame] | 110 | BSS(4) |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 111 | |
| 112 | _end = . ; |
| 113 | |
| 114 | /* This is where the kernel creates the early boot page tables */ |
Cyrill Gorcunov | cb32898 | 2008-12-10 12:43:19 +0000 | [diff] [blame] | 115 | . = ALIGN(PAGE_SIZE); |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 116 | pg0 = .; |
| 117 | |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 118 | STABS_DEBUG |
| 119 | |
| 120 | DWARF_DEBUG |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame^] | 121 | |
| 122 | /* Sections to be discarded */ |
| 123 | DISCARDS |
David Howells | b920de1 | 2008-02-08 04:19:31 -0800 | [diff] [blame] | 124 | } |