• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2023 Institute of Parallel And Distributed Systems (IPADS), Shanghai Jiao Tong University (SJTU)
3 * Licensed under the Mulan PSL v2.
4 * You can use this software according to the terms and conditions of the Mulan PSL v2.
5 * You may obtain a copy of Mulan PSL v2 at:
6 *     http://license.coscl.org.cn/MulanPSL2
7 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
8 * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
9 * PURPOSE.
10 * See the Mulan PSL v2 for more details.
11 */
12#include "image.h"
13
14ENTRY(_start)
15
16SECTIONS
17{
18    . = TEXT_OFFSET;
19
20    img_start = .;
21    init : {
22        ${init_objects}
23    }
24    . = ALIGN(4K);
25    init_end = ABSOLUTE(.);
26
27    .text KERNEL_VADDR + init_end : AT(init_end) {
28    _text_start = .;
29        *(.text*)
30    }
31    . = ALIGN(4K);
32    _text_end = .;
33
34    .data : {
35        *(.data*)
36    }
37    . = ALIGN(4K);
38
39    .rodata : {
40        *(.rodata*)
41        . = ALIGN(4K);
42        ${incbin_linker_script}
43    }
44    . = ALIGN(4K);
45    _edata = . - KERNEL_VADDR;
46
47    _bss_start = . - KERNEL_VADDR;
48    .bss : {
49        *(.bss*)
50    }
51    . = ALIGN(4K);
52    _bss_end = . - KERNEL_VADDR;
53
54    _extable_start = .;
55    .extable : {
56        *(.extable*)
57    }
58    . = ALIGN(4K);
59    _extable_end = .;
60
61    img_end = . - KERNEL_VADDR;
62
63    /DISCARD/ : { *(.comment) *(.gnu*) *(.note*) *(.eh_frame*) }
64}
65