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