1/*
2 * Copyright 2017, Data61
3 * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
4 * ABN 41 687 119 230.
5 *
6 * This software may be distributed and modified according to the terms of
7 * the GNU General Public License version 2. Note that NO WARRANTY is provided.
8 * See "LICENSE_GPLv2.txt" for details.
9 *
10 * @TAG(DATA61_GPL)
11 */
12
13#include <config.h>
14
15ENTRY(_start)
16
17/* WARNING: constants also defined in plat/machine/hardware.h */
18PHYS_BASE   = 0x01000000;
19#if defined(CONFIG_ARCH_AARCH32)
20KERNEL_BASE = 0xe0000000;
21#elif defined(CONFIG_ARCH_AARCH64)
22KERNEL_BASE = 0xffffff8000000000;
23#endif
24KERNEL_OFFSET = KERNEL_BASE - PHYS_BASE;
25
26SECTIONS
27{
28    . = KERNEL_BASE;
29
30    .boot . : AT(ADDR(.boot) - KERNEL_OFFSET)
31    {
32        *(.boot.text)
33        *(.boot.rodata)
34        *(.boot.data)
35        . = ALIGN(64K);
36    }
37
38    ki_boot_end = .;
39
40    .text . : AT(ADDR(.text) - KERNEL_OFFSET)
41    {
42        /* Sit inside a large frame */
43        . = ALIGN(64K);
44        *(.vectors)
45
46        /* Fastpath code */
47        *(.vectors.fastpath_call)
48        *(.vectors.fastpath_reply_recv)
49        *(.vectors.text)
50
51        /* Anything else that should be in the vectors page. */
52        *(.vectors.*)
53
54        /* Hopefully all that fits into 4K! */
55
56        /* Standard kernel */
57        *(.text)
58    }
59
60    .rodata . : AT(ADDR(.rodata) - KERNEL_OFFSET)
61    {
62        *(.rodata)
63        *(.rodata.*)
64    }
65
66    .data . : AT(ADDR(.data) - KERNEL_OFFSET)
67    {
68        *(.data)
69    }
70
71    .bss . : AT(ADDR(.bss) - KERNEL_OFFSET)
72    {
73        *(.bss)
74
75        /* 4k breakpoint stack */
76        _breakpoint_stack_bottom = .;
77        . = . + 4K;
78        _breakpoint_stack_top = .;
79
80        /* large data such as the globals frame and global PD */
81        *(.bss.aligned)
82    }
83
84    . = ALIGN(4K);
85    ki_end = .;
86
87    /DISCARD/ :
88    {
89        *(.note.gnu.build-id)
90        *(.comment)
91    }
92}
93