blob: 838a8443999cda6c450a37b5bf7f99d7671d6942 [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 : {
35 __global_pointer$ = . + 0x800;
36 *(.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
48 .u_boot_list : {
49 KEEP(*(SORT(.u_boot_list*)));
50 }
51
Bin Mengc7feb192018-09-26 06:55:12 -070052 . = ALIGN(4);
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
Bin Mengc7feb192018-09-26 06:55:12 -070061 . = ALIGN(4);
Rick Chen9677a372018-05-28 19:06:37 +080062
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 Mengc7feb192018-09-26 06:55:12 -070070 . = ALIGN(4);
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 Mengc7feb192018-09-26 06:55:12 -070078 . = ALIGN(4);
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}