Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu> |
| 3 | * Copyright (C) 2008-2009 PetaLogix |
| 4 | * Copyright (C) 2006 Atmark Techno, Inc. |
| 5 | * |
| 6 | * This file is subject to the terms and conditions of the GNU General Public |
| 7 | * License. See the file "COPYING" in the main directory of this archive |
| 8 | * for more details. |
| 9 | */ |
| 10 | |
| 11 | OUTPUT_FORMAT("elf32-microblaze", "elf32-microblaze", "elf32-microblaze") |
| 12 | OUTPUT_ARCH(microblaze) |
| 13 | ENTRY(_start) |
| 14 | |
| 15 | #include <asm-generic/vmlinux.lds.h> |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame^] | 16 | #include <asm/page.h> |
| 17 | #include <asm/thread_info.h> |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 18 | |
| 19 | jiffies = jiffies_64 + 4; |
| 20 | |
| 21 | SECTIONS { |
Michal Simek | d4c1285 | 2009-05-26 16:30:24 +0200 | [diff] [blame] | 22 | . = CONFIG_KERNEL_START; |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 23 | .text : { |
| 24 | _text = . ; |
| 25 | _stext = . ; |
| 26 | *(.text .text.*) |
| 27 | *(.fixup) |
Michal Simek | 1dcdd09 | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 28 | EXIT_TEXT |
| 29 | EXIT_CALL |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 30 | SCHED_TEXT |
| 31 | LOCK_TEXT |
| 32 | KPROBES_TEXT |
| 33 | . = ALIGN (4) ; |
| 34 | _etext = . ; |
| 35 | } |
| 36 | |
| 37 | . = ALIGN (4) ; |
| 38 | _fdt_start = . ; /* place for fdt blob */ |
| 39 | . = . + 0x4000; |
| 40 | _fdt_end = . ; |
| 41 | |
| 42 | . = ALIGN(16); |
| 43 | RODATA |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame^] | 44 | EXCEPTION_TABLE(16) |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 45 | |
| 46 | /* |
| 47 | * sdata2 section can go anywhere, but must be word aligned |
| 48 | * and SDA2_BASE must point to the middle of it |
| 49 | */ |
| 50 | .sdata2 : { |
| 51 | _ssrw = .; |
| 52 | . = ALIGN(4096); /* page aligned when MMU used - origin 0x8 */ |
| 53 | *(.sdata2) |
| 54 | . = ALIGN(8); |
| 55 | _essrw = .; |
| 56 | _ssrw_size = _essrw - _ssrw; |
| 57 | _KERNEL_SDA2_BASE_ = _ssrw + (_ssrw_size / 2); |
| 58 | } |
| 59 | |
| 60 | _sdata = . ; |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame^] | 61 | RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE) |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 62 | _edata = . ; |
| 63 | |
| 64 | /* Reserve some low RAM for r0 based memory references */ |
| 65 | . = ALIGN(0x4) ; |
| 66 | r0_ram = . ; |
| 67 | . = . + 4096; /* a page should be enough */ |
| 68 | |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 69 | /* Under the microblaze ABI, .sdata and .sbss must be contiguous */ |
| 70 | . = ALIGN(8); |
| 71 | .sdata : { |
| 72 | _ssro = .; |
| 73 | *(.sdata) |
| 74 | } |
| 75 | |
| 76 | .sbss : { |
| 77 | _ssbss = .; |
| 78 | *(.sbss) |
| 79 | _esbss = .; |
| 80 | _essro = .; |
| 81 | _ssro_size = _essro - _ssro ; |
| 82 | _KERNEL_SDA_BASE_ = _ssro + (_ssro_size / 2) ; |
| 83 | } |
| 84 | |
| 85 | __init_begin = .; |
| 86 | |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame^] | 87 | INIT_TEXT_SECTION(PAGE_SIZE) |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 88 | |
Michal Simek | 05bf7d4 | 2009-06-20 14:24:01 +0200 | [diff] [blame] | 89 | .init.data : { |
| 90 | INIT_DATA |
| 91 | } |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 92 | |
| 93 | . = ALIGN(4); |
| 94 | .init.ivt : { |
| 95 | __ivt_start = .; |
| 96 | *(.init.ivt) |
| 97 | __ivt_end = .; |
| 98 | } |
| 99 | |
| 100 | .init.setup : { |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame^] | 101 | INIT_SETUP(0) |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 102 | } |
| 103 | |
| 104 | .initcall.init : { |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame^] | 105 | INIT_CALLS |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | .con_initcall.init : { |
Tim Abbott | 8cc11f5 | 2009-09-06 23:10:10 -0400 | [diff] [blame^] | 109 | CON_INITCALL |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 110 | } |
| 111 | |
Arnd Bergmann | 6b43742 | 2009-05-01 21:36:44 +0000 | [diff] [blame] | 112 | SECURITY_INIT |
| 113 | |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 114 | __init_end_before_initramfs = .; |
| 115 | |
| 116 | .init.ramfs ALIGN(4096) : { |
| 117 | __initramfs_start = .; |
| 118 | *(.init.ramfs) |
| 119 | __initramfs_end = .; |
| 120 | . = ALIGN(4); |
| 121 | LONG(0); |
| 122 | /* |
| 123 | * FIXME this can break initramfs for MMU. |
| 124 | * Pad init.ramfs up to page boundary, |
| 125 | * so that __init_end == __bss_start. This will make image.elf |
| 126 | * consistent with the image.bin |
| 127 | */ |
| 128 | /* . = ALIGN(4096); */ |
| 129 | } |
| 130 | __init_end = .; |
| 131 | |
| 132 | .bss ALIGN (4096) : { /* page aligned when MMU used */ |
| 133 | __bss_start = . ; |
| 134 | *(.bss*) |
| 135 | *(COMMON) |
| 136 | . = ALIGN (4) ; |
| 137 | __bss_stop = . ; |
| 138 | _ebss = . ; |
| 139 | } |
| 140 | . = ALIGN(4096); |
| 141 | _end = .; |
Tejun Heo | 405d967 | 2009-06-24 15:13:38 +0900 | [diff] [blame] | 142 | |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 143 | DISCARDS |
Michal Simek | 16bfeaf | 2009-03-27 14:25:20 +0100 | [diff] [blame] | 144 | } |