blob: b11ea8b56d2576a439bfab4d3714cb71620ea497 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Rick Chene76b8042017-12-26 13:55:48 +08002/*
3 * Copyright (C) 2017 Andes Technology Corporation
4 * Rick Chen, Andes Technology Corporation <rick@andestech.com>
Rick Chene76b8042017-12-26 13:55:48 +08005 */
Bin Mengc7feb192018-09-26 06:55:12 -07006
Rick Chene76b8042017-12-26 13:55:48 +08007OUTPUT_ARCH("riscv")
8ENTRY(_start)
9
10SECTIONS
11{
12 . = ALIGN(4);
Yao Zia97117d2025-04-16 16:25:33 +000013 __image_copy_start = ADDR(.text);
Bin Mengc7feb192018-09-26 06:55:12 -070014 .text : {
Bin Mengbcb38432018-09-26 06:55:17 -070015 arch/riscv/cpu/start.o (.text)
Rick Chene76b8042017-12-26 13:55:48 +080016 }
17
Alexander Graf94a10f22018-06-12 07:48:37 +020018 /* This needs to come before *(.text*) */
19 .efi_runtime : {
Bin Mengc7feb192018-09-26 06:55:12 -070020 __efi_runtime_start = .;
Alexander Graf94a10f22018-06-12 07:48:37 +020021 *(.text.efi_runtime*)
22 *(.rodata.efi_runtime*)
23 *(.data.efi_runtime*)
Bin Mengc7feb192018-09-26 06:55:12 -070024 __efi_runtime_stop = .;
Alexander Graf94a10f22018-06-12 07:48:37 +020025 }
26
Bin Mengc7feb192018-09-26 06:55:12 -070027 .text_rest : {
Alexander Graf94a10f22018-06-12 07:48:37 +020028 *(.text*)
29 }
30
Rick Chene76b8042017-12-26 13:55:48 +080031 . = ALIGN(4);
32 .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
33
34 . = ALIGN(4);
35 .data : {
Rick Chene76b8042017-12-26 13:55:48 +080036 *(.data*)
37 }
38 . = ALIGN(4);
39
40 .got : {
Bin Mengc7feb192018-09-26 06:55:12 -070041 __got_start = .;
42 *(.got.plt) *(.got)
43 __got_end = .;
44 }
Rick Chene76b8042017-12-26 13:55:48 +080045
46 . = ALIGN(4);
47
Andrew Scull5a9095c2022-05-30 10:00:04 +000048 __u_boot_list : {
49 KEEP(*(SORT(__u_boot_list*)));
Rick Chene76b8042017-12-26 13:55:48 +080050 }
51
Bin Meng50e7d712023-06-27 09:24:56 +080052 . = ALIGN(8);
Rick Chene76b8042017-12-26 13:55:48 +080053
Rick Chen9677a372018-05-28 19:06:37 +080054 .efi_runtime_rel : {
Bin Mengc7feb192018-09-26 06:55:12 -070055 __efi_runtime_rel_start = .;
Alexander Graf94a10f22018-06-12 07:48:37 +020056 *(.rel*.efi_runtime)
57 *(.rel*.efi_runtime.*)
Bin Mengc7feb192018-09-26 06:55:12 -070058 __efi_runtime_rel_stop = .;
Rick Chen9677a372018-05-28 19:06:37 +080059 }
60
Yao Zia97117d2025-04-16 16:25:33 +000061 __image_copy_end = .;
62
Bin Mengc7feb192018-09-26 06:55:12 -070063 /DISCARD/ : { *(.rela.plt*) }
64 .rela.dyn : {
65 __rel_dyn_start = .;
66 *(.rela*)
67 __rel_dyn_end = .;
68 }
Rick Chene76b8042017-12-26 13:55:48 +080069
Bin Meng44787272023-04-13 14:20:08 +080070 . = ALIGN(8);
Rick Chene76b8042017-12-26 13:55:48 +080071
Bin Mengc7feb192018-09-26 06:55:12 -070072 .dynsym : {
73 __dyn_sym_start = .;
74 *(.dynsym)
75 __dyn_sym_end = .;
76 }
Rick Chene76b8042017-12-26 13:55:48 +080077
Bin Meng44787272023-04-13 14:20:08 +080078 . = ALIGN(8);
Rick Chene76b8042017-12-26 13:55:48 +080079
80 _end = .;
81
82 .bss : {
Bin Mengc7feb192018-09-26 06:55:12 -070083 __bss_start = .;
84 *(.bss*)
Rick Chen55bc1bd2019-11-14 13:52:27 +080085 . = ALIGN(8);
Rick Chene76b8042017-12-26 13:55:48 +080086 __bss_end = .;
87 }
Rick Chene76b8042017-12-26 13:55:48 +080088}