linux/arch/microblaze/kernel/vmlinux.lds.S
<<
>>
Prefs
   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
  11OUTPUT_FORMAT("elf32-microblaze", "elf32-microblaze", "elf32-microblaze")
  12OUTPUT_ARCH(microblaze)
  13ENTRY(_start)
  14
  15#include <asm/page.h>
  16#include <asm-generic/vmlinux.lds.h>
  17#include <asm/thread_info.h>
  18
  19jiffies = jiffies_64 + 4;
  20
  21SECTIONS {
  22        . = CONFIG_KERNEL_START;
  23        _start = CONFIG_KERNEL_BASE_ADDR;
  24        .text : AT(ADDR(.text) - LOAD_OFFSET) {
  25                _text = . ;
  26                _stext = . ;
  27                *(.text .text.*)
  28                *(.fixup)
  29               EXIT_TEXT
  30               EXIT_CALL
  31                SCHED_TEXT
  32                LOCK_TEXT
  33                KPROBES_TEXT
  34                . = ALIGN (4) ;
  35                _etext = . ;
  36        }
  37
  38        . = ALIGN (4) ;
  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        }
  45
  46        . = ALIGN(16);
  47        RODATA
  48        EXCEPTION_TABLE(16)
  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         */
  54        .sdata2 : AT(ADDR(.sdata2) - LOAD_OFFSET) {
  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 = . ;
  65        RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE)
  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
  73        /* Under the microblaze ABI, .sdata and .sbss must be contiguous */
  74        . = ALIGN(8);
  75        .sdata : AT(ADDR(.sdata) - LOAD_OFFSET) {
  76                _ssro = .;
  77                *(.sdata)
  78        }
  79
  80        .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) {
  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
  91        INIT_TEXT_SECTION(PAGE_SIZE)
  92
  93        .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
  94                INIT_DATA
  95        }
  96
  97        . = ALIGN(4);
  98        .init.ivt : AT(ADDR(.init.ivt) - LOAD_OFFSET) {
  99                __ivt_start = .;
 100                *(.init.ivt)
 101                __ivt_end = .;
 102        }
 103
 104        .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
 105                INIT_SETUP(0)
 106        }
 107
 108        .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET ) {
 109                INIT_CALLS
 110        }
 111
 112        .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
 113                CON_INITCALL
 114        }
 115
 116        SECURITY_INIT
 117
 118        __init_end_before_initramfs = .;
 119
 120        .init.ramfs ALIGN(4096) : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
 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
 136        .bss ALIGN (4096) : AT(ADDR(.bss) - LOAD_OFFSET) {
 137                /* page aligned when MMU used */
 138                __bss_start = . ;
 139                        *(.bss*)
 140                        *(COMMON)
 141                . = ALIGN (4) ;
 142                __bss_stop = . ;
 143                _ebss = . ;
 144        }
 145        . = ALIGN(4096);
 146        _end = .;
 147
 148        DISCARDS
 149}
 150