OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [include/] [physlink.lds.in] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * Simple linker script
3
 *
4
 * Copyright (C) 2007 Bahadir Balban
5
 */
6
 
7
phys_ram_start          = PLATFORM_PHYS_MEM_START;
8
kernel_offset           = 0x00000000;
9
kernel_physical         = 0x8000 + phys_ram_start;
10
kernel_virtual          = kernel_physical + kernel_offset;
11
 
12
/* A temporary boot stack is used before a proper kernel stack is set up */
13
_bootstack_physical     = _bootstack - kernel_offset;
14
_secondary_bootstack_physical   = _secondary_bootstack - kernel_offset;
15
 
16
/* The symbols are linked at virtual addresses. So is _start.
17
 * We must set the entry point to a physical address, so that
18
 * when the image is loaded, it doesn't jump to a non existing
19
 * virtual address.
20
 */
21
ENTRY(kernel_physical)
22
 
23
SECTIONS
24
{
25
        . = kernel_virtual;
26
        _start_kernel = .;
27
        .text : AT (ADDR(.text) - kernel_offset)
28
        {
29
                _start_text = .;
30
                /* Make sure head.S comes first */
31
                /* *head.o(.text) This only works when given its full path. Bad limitation. */
32
                *(.text.head)
33
                *(.text)
34
                _end_text = .;
35
        }
36
        . = ALIGN(4);
37
        /* rodata is needed else your strings will link at physical! */
38
        .rodata : AT (ADDR(.rodata) - kernel_offset) { *(.rodata) }
39
        .rodata1 : AT (ADDR(.rodata1) - kernel_offset) { *(.rodata1) }
40
        .data : AT (ADDR(.data) - kernel_offset)
41
        {
42
                _start_data = .;
43
                *(.data)
44
                _start_vectors = .;
45
                *(.data.vectors)
46
                . = ALIGN(4K);
47
                _end_vectors = .;
48
                *(.data.pgd)
49
                _start_kip = .;
50
                *(.data.kip)
51
                . = ALIGN(4K);
52
                _end_kip = .;
53
                _start_syscalls = .;
54
                *(.data.syscalls)
55
                . = ALIGN(4K);
56
                _end_syscalls = .;
57
                *(.data.pgd); /* Global table on split tables, otherwise nil */
58
                _end_data = .;
59
        }
60
        .bss : AT (ADDR(.bss) - kernel_offset)
61
        {
62
                *(.bss)
63
        }
64
        . = ALIGN(4K);
65
        . += 0x2000;            /* This is required as the link counter does not seem
66
                                 * to increment for the bss section
67
                                 * TODO: Change this with PAGE_SIZE */
68
 
69
        /* Below part is to be discarded after boot */
70
        _start_init = .;
71
        .init : AT (ADDR(.init) - kernel_offset)
72
        {
73
                *(.init.pgd)            /* Global table on _non_-split tables, otherwise nil */
74
                *(.init.task.pgd)       /* Non-global task table on split tables, otherwise nil */
75
                *(.init.bootmem)
76
                *(.init.data)
77
        }
78
        /* Space for boot stack */
79
        . += 0x1000;
80
        . = ALIGN(4K);  /* A page aligned stack of at least 4KB */
81
        _end_init = .;
82
        _bootstack = .;
83
        . += 0x1000;
84
        . = ALIGN(4K);
85
        _secondary_bootstack = .;
86
        _end_kernel = .;
87
        _end = .;
88
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.