blob: c00d17c73696e09a67e05288026d118bb595f0be [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Rick Chene8e39592017-12-26 13:55:48 +08002/*
3 * Copyright (C) 2017 Andes Technology Corporation
4 * Rick Chen, Andes Technology Corporation <rick@andestech.com>
Rick Chene8e39592017-12-26 13:55:48 +08005 */
Bin Meng3d601562018-09-26 06:55:12 -07006
Rick Chene8e39592017-12-26 13:55:48 +08007OUTPUT_ARCH("riscv")
8ENTRY(_start)
9
10SECTIONS
11{
12 . = ALIGN(4);
Bin Meng3d601562018-09-26 06:55:12 -070013 .text : {
Bin Mengb5369c52018-09-26 06:55:17 -070014 arch/riscv/cpu/start.o (.text)
Alexander Graf7e21fbc2018-06-12 07:48:37 +020015 }
16
17 /* This needs to come before *(.text*) */
18 .efi_runtime : {
Bin Meng3d601562018-09-26 06:55:12 -070019 __efi_runtime_start = .;
Alexander Graf7e21fbc2018-06-12 07:48:37 +020020 *(.text.efi_runtime*)
21 *(.rodata.efi_runtime*)
22 *(.data.efi_runtime*)
Bin Meng3d601562018-09-26 06:55:12 -070023 __efi_runtime_stop = .;
Alexander Graf7e21fbc2018-06-12 07:48:37 +020024 }
25
Bin Meng3d601562018-09-26 06:55:12 -070026 .text_rest : {
Alexander Graf7e21fbc2018-06-12 07:48:37 +020027 *(.text*)
Rick Chene8e39592017-12-26 13:55:48 +080028 }
29
30 . = ALIGN(4);
31 .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
32
33 . = ALIGN(4);
34 .data : {
Rick Chene8e39592017-12-26 13:55:48 +080035 *(.data*)
36 }
37 . = ALIGN(4);
38
39 .got : {
Bin Meng3d601562018-09-26 06:55:12 -070040 __got_start = .;
41 *(.got.plt) *(.got)
42 __got_end = .;
43 }
Rick Chene8e39592017-12-26 13:55:48 +080044
45 . = ALIGN(4);
46
47 .u_boot_list : {
48 KEEP(*(SORT(.u_boot_list*)));
49 }
50
Bin Meng3d601562018-09-26 06:55:12 -070051 . = ALIGN(4);
Rick Chene8e39592017-12-26 13:55:48 +080052
Rick Chen6836adb2018-05-28 19:06:37 +080053 .efi_runtime_rel : {
Bin Meng3d601562018-09-26 06:55:12 -070054 __efi_runtime_rel_start = .;
Alexander Graf7e21fbc2018-06-12 07:48:37 +020055 *(.rel*.efi_runtime)
56 *(.rel*.efi_runtime.*)
Bin Meng3d601562018-09-26 06:55:12 -070057 __efi_runtime_rel_stop = .;
Rick Chen6836adb2018-05-28 19:06:37 +080058 }
59
Bin Meng3d601562018-09-26 06:55:12 -070060 . = ALIGN(4);
Rick Chen6836adb2018-05-28 19:06:37 +080061
Bin Meng3d601562018-09-26 06:55:12 -070062 /DISCARD/ : { *(.rela.plt*) }
63 .rela.dyn : {
64 __rel_dyn_start = .;
65 *(.rela*)
66 __rel_dyn_end = .;
67 }
Rick Chene8e39592017-12-26 13:55:48 +080068
Bin Meng3d601562018-09-26 06:55:12 -070069 . = ALIGN(4);
Rick Chene8e39592017-12-26 13:55:48 +080070
Bin Meng3d601562018-09-26 06:55:12 -070071 .dynsym : {
72 __dyn_sym_start = .;
73 *(.dynsym)
74 __dyn_sym_end = .;
75 }
Rick Chene8e39592017-12-26 13:55:48 +080076
Bin Meng3d601562018-09-26 06:55:12 -070077 . = ALIGN(4);
Rick Chene8e39592017-12-26 13:55:48 +080078
79 _end = .;
80
81 .bss : {
Bin Meng3d601562018-09-26 06:55:12 -070082 __bss_start = .;
83 *(.bss*)
Rick Chen444c4642019-11-14 13:52:27 +080084 . = ALIGN(8);
Rick Chene8e39592017-12-26 13:55:48 +080085 __bss_end = .;
86 }
Rick Chene8e39592017-12-26 13:55:48 +080087}