blob: 2ffe6ba3c8f007839ba4ab1f60c923168b180510 [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);
Bin Mengc7feb192018-09-26 06:55:12 -070013 .text : {
Bin Mengbcb38432018-09-26 06:55:17 -070014 arch/riscv/cpu/start.o (.text)
Rick Chene76b8042017-12-26 13:55:48 +080015 }
16
Alexander Graf94a10f22018-06-12 07:48:37 +020017 /* This needs to come before *(.text*) */
18 .efi_runtime : {
Bin Mengc7feb192018-09-26 06:55:12 -070019 __efi_runtime_start = .;
Alexander Graf94a10f22018-06-12 07:48:37 +020020 *(.text.efi_runtime*)
21 *(.rodata.efi_runtime*)
22 *(.data.efi_runtime*)
Bin Mengc7feb192018-09-26 06:55:12 -070023 __efi_runtime_stop = .;
Alexander Graf94a10f22018-06-12 07:48:37 +020024 }
25
Bin Mengc7feb192018-09-26 06:55:12 -070026 .text_rest : {
Alexander Graf94a10f22018-06-12 07:48:37 +020027 *(.text*)
28 }
29
Rick Chene76b8042017-12-26 13:55:48 +080030 . = ALIGN(4);
31 .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
32
33 . = ALIGN(4);
34 .data : {
Rick Chene76b8042017-12-26 13:55:48 +080035 *(.data*)
36 }
37 . = ALIGN(4);
38
39 .got : {
Bin Mengc7feb192018-09-26 06:55:12 -070040 __got_start = .;
41 *(.got.plt) *(.got)
42 __got_end = .;
43 }
Rick Chene76b8042017-12-26 13:55:48 +080044
45 . = ALIGN(4);
46
Andrew Scull5a9095c2022-05-30 10:00:04 +000047 __u_boot_list : {
48 KEEP(*(SORT(__u_boot_list*)));
Rick Chene76b8042017-12-26 13:55:48 +080049 }
50
Bin Meng50e7d712023-06-27 09:24:56 +080051 . = ALIGN(8);
Rick Chene76b8042017-12-26 13:55:48 +080052
Rick Chen9677a372018-05-28 19:06:37 +080053 .efi_runtime_rel : {
Bin Mengc7feb192018-09-26 06:55:12 -070054 __efi_runtime_rel_start = .;
Alexander Graf94a10f22018-06-12 07:48:37 +020055 *(.rel*.efi_runtime)
56 *(.rel*.efi_runtime.*)
Bin Mengc7feb192018-09-26 06:55:12 -070057 __efi_runtime_rel_stop = .;
Rick Chen9677a372018-05-28 19:06:37 +080058 }
59
Bin Mengc7feb192018-09-26 06:55:12 -070060 /DISCARD/ : { *(.rela.plt*) }
61 .rela.dyn : {
62 __rel_dyn_start = .;
63 *(.rela*)
64 __rel_dyn_end = .;
65 }
Rick Chene76b8042017-12-26 13:55:48 +080066
Bin Meng44787272023-04-13 14:20:08 +080067 . = ALIGN(8);
Rick Chene76b8042017-12-26 13:55:48 +080068
Bin Mengc7feb192018-09-26 06:55:12 -070069 .dynsym : {
70 __dyn_sym_start = .;
71 *(.dynsym)
72 __dyn_sym_end = .;
73 }
Rick Chene76b8042017-12-26 13:55:48 +080074
Bin Meng44787272023-04-13 14:20:08 +080075 . = ALIGN(8);
Rick Chene76b8042017-12-26 13:55:48 +080076
77 _end = .;
78
79 .bss : {
Bin Mengc7feb192018-09-26 06:55:12 -070080 __bss_start = .;
81 *(.bss*)
Rick Chen55bc1bd2019-11-14 13:52:27 +080082 . = ALIGN(8);
Rick Chene76b8042017-12-26 13:55:48 +080083 __bss_end = .;
84 }
Rick Chene76b8042017-12-26 13:55:48 +080085}