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