diff options
Diffstat (limited to 'lib/chibios-contrib/os/common/startup/RISCV-ECLIC/compilers/GCC/ld/rules_code.ld')
-rw-r--r-- | lib/chibios-contrib/os/common/startup/RISCV-ECLIC/compilers/GCC/ld/rules_code.ld | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/lib/chibios-contrib/os/common/startup/RISCV-ECLIC/compilers/GCC/ld/rules_code.ld b/lib/chibios-contrib/os/common/startup/RISCV-ECLIC/compilers/GCC/ld/rules_code.ld new file mode 100644 index 000000000..36969fb3a --- /dev/null +++ b/lib/chibios-contrib/os/common/startup/RISCV-ECLIC/compilers/GCC/ld/rules_code.ld | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | ChibiOS - Copyright (C) 2020 Patrick Seidel | ||
3 | |||
4 | Licensed under the Apache License, Version 2.0 (the "License"); | ||
5 | you may not use this file except in compliance with the License. | ||
6 | You may obtain a copy of the License at | ||
7 | |||
8 | http://www.apache.org/licenses/LICENSE-2.0 | ||
9 | |||
10 | Unless required by applicable law or agreed to in writing, software | ||
11 | distributed under the License is distributed on an "AS IS" BASIS, | ||
12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
13 | See the License for the specific language governing permissions and | ||
14 | limitations under the License. | ||
15 | */ | ||
16 | |||
17 | ENTRY(_start) | ||
18 | |||
19 | SECTIONS | ||
20 | { | ||
21 | .vectors : ALIGN(4) | ||
22 | { | ||
23 | KEEP (*(SORT_NONE(.crt0))) | ||
24 | /* For 65 to 128 interrupts, the vector table must be 512 byte aligned. | ||
25 | * See: https://doc.nucleisys.com/nuclei_spec/isa/core_csr.html#mtvt */ | ||
26 | . = ALIGN(512); | ||
27 | KEEP (*(SORT_NONE(.vectors))) | ||
28 | } > VECTORS_FLASH AT > VECTORS_FLASH_LMA | ||
29 | |||
30 | .xtors : ALIGN(4) | ||
31 | { | ||
32 | __init_array_base__ = .; | ||
33 | KEEP(*(SORT(.init_array.*))) | ||
34 | KEEP(*(.init_array)) | ||
35 | __init_array_end__ = .; | ||
36 | __fini_array_base__ = .; | ||
37 | KEEP(*(.fini_array)) | ||
38 | KEEP(*(SORT(.fini_array.*))) | ||
39 | __fini_array_end__ = .; | ||
40 | } > XTORS_FLASH AT > XTORS_FLASH_LMA | ||
41 | |||
42 | .text : ALIGN_WITH_INPUT | ||
43 | { | ||
44 | __text_base__ = .; | ||
45 | *(.text) | ||
46 | *(.text.*) | ||
47 | *(.gcc*) | ||
48 | __text_end__ = .; | ||
49 | } > TEXT_FLASH AT > TEXT_FLASH_LMA | ||
50 | |||
51 | .rodata : ALIGN(4) | ||
52 | { | ||
53 | __rodata_base__ = .; | ||
54 | *(.rodata) | ||
55 | *(.rodata.*) | ||
56 | *(.srodata) | ||
57 | *(.srodata.*) | ||
58 | . = ALIGN(4); | ||
59 | __rodata_end__ = .; | ||
60 | } > RODATA_FLASH AT > RODATA_FLASH_LMA | ||
61 | |||
62 | .eh_frame_hdr : | ||
63 | { | ||
64 | *(.eh_frame_hdr) | ||
65 | } > VARIOUS_FLASH AT > VARIOUS_FLASH_LMA | ||
66 | |||
67 | .eh_frame : ONLY_IF_RO | ||
68 | { | ||
69 | *(.eh_frame) | ||
70 | } > VARIOUS_FLASH AT > VARIOUS_FLASH_LMA | ||
71 | } | ||