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