blob: 15b5cbc585dba17088f1a8af188cbdef05091e20 [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 Mengc7feb192018-09-26 06:55:12 -070051 . = ALIGN(4);
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 Meng44787272023-04-13 14:20:08 +080060 . = ALIGN(8);
Rick Chen9677a372018-05-28 19:06:37 +080061
Bin Mengc7feb192018-09-26 06:55:12 -070062 /DISCARD/ : { *(.rela.plt*) }
63 .rela.dyn : {
64 __rel_dyn_start = .;
65 *(.rela*)
66 __rel_dyn_end = .;
67 }
Rick Chene76b8042017-12-26 13:55:48 +080068
Bin Meng44787272023-04-13 14:20:08 +080069 . = ALIGN(8);
Rick Chene76b8042017-12-26 13:55:48 +080070
Bin Mengc7feb192018-09-26 06:55:12 -070071 .dynsym : {
72 __dyn_sym_start = .;
73 *(.dynsym)
74 __dyn_sym_end = .;
75 }
Rick Chene76b8042017-12-26 13:55:48 +080076
Bin Meng44787272023-04-13 14:20:08 +080077 . = ALIGN(8);
Rick Chene76b8042017-12-26 13:55:48 +080078
79 _end = .;
80
81 .bss : {
Bin Mengc7feb192018-09-26 06:55:12 -070082 __bss_start = .;
83 *(.bss*)
Rick Chen55bc1bd2019-11-14 13:52:27 +080084 . = ALIGN(8);
Rick Chene76b8042017-12-26 13:55:48 +080085 __bss_end = .;
86 }
Rick Chene76b8042017-12-26 13:55:48 +080087}