blob: 838a8443999cda6c450a37b5bf7f99d7671d6942 [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 : {
35 __global_pointer$ = . + 0x800;
36 *(.data*)
37 }
38 . = ALIGN(4);
39
40 .got : {
Bin Meng3d601562018-09-26 06:55:12 -070041 __got_start = .;
42 *(.got.plt) *(.got)
43 __got_end = .;
44 }
Rick Chene8e39592017-12-26 13:55:48 +080045
46 . = ALIGN(4);
47
48 .u_boot_list : {
49 KEEP(*(SORT(.u_boot_list*)));
50 }
51
Bin Meng3d601562018-09-26 06:55:12 -070052 . = ALIGN(4);
Rick Chene8e39592017-12-26 13:55:48 +080053
Rick Chen6836adb2018-05-28 19:06:37 +080054 .efi_runtime_rel : {
Bin Meng3d601562018-09-26 06:55:12 -070055 __efi_runtime_rel_start = .;
Alexander Graf7e21fbc2018-06-12 07:48:37 +020056 *(.rel*.efi_runtime)
57 *(.rel*.efi_runtime.*)
Bin Meng3d601562018-09-26 06:55:12 -070058 __efi_runtime_rel_stop = .;
Rick Chen6836adb2018-05-28 19:06:37 +080059 }
60
Bin Meng3d601562018-09-26 06:55:12 -070061 . = ALIGN(4);
Rick Chen6836adb2018-05-28 19:06:37 +080062
Bin Meng3d601562018-09-26 06:55:12 -070063 /DISCARD/ : { *(.rela.plt*) }
64 .rela.dyn : {
65 __rel_dyn_start = .;
66 *(.rela*)
67 __rel_dyn_end = .;
68 }
Rick Chene8e39592017-12-26 13:55:48 +080069
Bin Meng3d601562018-09-26 06:55:12 -070070 . = ALIGN(4);
Rick Chene8e39592017-12-26 13:55:48 +080071
Bin Meng3d601562018-09-26 06:55:12 -070072 .dynsym : {
73 __dyn_sym_start = .;
74 *(.dynsym)
75 __dyn_sym_end = .;
76 }
Rick Chene8e39592017-12-26 13:55:48 +080077
Bin Meng3d601562018-09-26 06:55:12 -070078 . = ALIGN(4);
Rick Chene8e39592017-12-26 13:55:48 +080079
80 _end = .;
81
82 .bss : {
Bin Meng3d601562018-09-26 06:55:12 -070083 __bss_start = .;
84 *(.bss*)
Rick Chen444c4642019-11-14 13:52:27 +080085 . = ALIGN(8);
Rick Chene8e39592017-12-26 13:55:48 +080086 __bss_end = .;
87 }
Rick Chene8e39592017-12-26 13:55:48 +080088}