riscv: Move the linker script to the CPU root directory
[oweals/u-boot.git] / arch / riscv / cpu / u-boot.lds
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2017 Andes Technology Corporation
4  * Rick Chen, Andes Technology Corporation <rick@andestech.com>
5  */
6 OUTPUT_ARCH("riscv")
7 ENTRY(_start)
8
9 SECTIONS
10 {
11         . = ALIGN(4);
12         .text :
13         {
14                 arch/riscv/cpu/ax25/start.o     (.text)
15         }
16
17         /* This needs to come before *(.text*) */
18         .efi_runtime : {
19                 __efi_runtime_start = .;
20                 *(.text.efi_runtime*)
21                 *(.rodata.efi_runtime*)
22                 *(.data.efi_runtime*)
23                 __efi_runtime_stop = .;
24         }
25
26         .text_rest :
27         {
28                 *(.text*)
29         }
30
31         . = ALIGN(4);
32         .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
33
34         . = ALIGN(4);
35         .data : {
36                 __global_pointer$ = . + 0x800;
37                 *(.data*)
38         }
39         . = ALIGN(4);
40
41         .got : {
42            __got_start = .;
43            *(.got.plt) *(.got)
44            __got_end = .;
45     }
46
47         . = ALIGN(4);
48
49         .u_boot_list : {
50                 KEEP(*(SORT(.u_boot_list*)));
51         }
52
53     . = ALIGN(4);
54
55         .efi_runtime_rel : {
56                 __efi_runtime_rel_start = .;
57                 *(.rel*.efi_runtime)
58                 *(.rel*.efi_runtime.*)
59                 __efi_runtime_rel_stop = .;
60         }
61
62     . = ALIGN(4);
63
64     /DISCARD/ : { *(.rela.plt*) }
65     .rela.dyn : {
66         __rel_dyn_start = .;
67         *(.rela*)
68         __rel_dyn_end = .;
69     }
70
71     . = ALIGN(4);
72
73     .dynsym : {
74         __dyn_sym_start = .;
75         *(.dynsym)
76         __dyn_sym_end = .;
77     }
78
79     . = ALIGN(4);
80
81         _end = .;
82
83         .bss : {
84         __bss_start = .;
85         *(.bss*)
86                 . = ALIGN(4);
87                 __bss_end = .;
88         }
89
90 }