Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 2 | /* |
3 | * Copyright (C) 2017 Andes Technology Corporation | ||||
4 | * Rick Chen, Andes Technology Corporation <rick@andestech.com> | ||||
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 5 | */ |
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 6 | |
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 7 | OUTPUT_ARCH("riscv") |
8 | ENTRY(_start) | ||||
9 | |||||
10 | SECTIONS | ||||
11 | { | ||||
12 | . = ALIGN(4); | ||||
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 13 | .text : { |
Bin Meng | bcb3843 | 2018-09-26 06:55:17 -0700 | [diff] [blame] | 14 | arch/riscv/cpu/start.o (.text) |
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 15 | } |
16 | |||||
Alexander Graf | 94a10f2 | 2018-06-12 07:48:37 +0200 | [diff] [blame] | 17 | /* This needs to come before *(.text*) */ |
18 | .efi_runtime : { | ||||
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 19 | __efi_runtime_start = .; |
Alexander Graf | 94a10f2 | 2018-06-12 07:48:37 +0200 | [diff] [blame] | 20 | *(.text.efi_runtime*) |
21 | *(.rodata.efi_runtime*) | ||||
22 | *(.data.efi_runtime*) | ||||
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 23 | __efi_runtime_stop = .; |
Alexander Graf | 94a10f2 | 2018-06-12 07:48:37 +0200 | [diff] [blame] | 24 | } |
25 | |||||
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 26 | .text_rest : { |
Alexander Graf | 94a10f2 | 2018-06-12 07:48:37 +0200 | [diff] [blame] | 27 | *(.text*) |
28 | } | ||||
29 | |||||
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 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 Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 41 | __got_start = .; |
42 | *(.got.plt) *(.got) | ||||
43 | __got_end = .; | ||||
44 | } | ||||
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 45 | |
46 | . = ALIGN(4); | ||||
47 | |||||
48 | .u_boot_list : { | ||||
49 | KEEP(*(SORT(.u_boot_list*))); | ||||
50 | } | ||||
51 | |||||
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 52 | . = ALIGN(4); |
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 53 | |
Rick Chen | 9677a37 | 2018-05-28 19:06:37 +0800 | [diff] [blame] | 54 | .efi_runtime_rel : { |
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 55 | __efi_runtime_rel_start = .; |
Alexander Graf | 94a10f2 | 2018-06-12 07:48:37 +0200 | [diff] [blame] | 56 | *(.rel*.efi_runtime) |
57 | *(.rel*.efi_runtime.*) | ||||
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 58 | __efi_runtime_rel_stop = .; |
Rick Chen | 9677a37 | 2018-05-28 19:06:37 +0800 | [diff] [blame] | 59 | } |
60 | |||||
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 61 | . = ALIGN(4); |
Rick Chen | 9677a37 | 2018-05-28 19:06:37 +0800 | [diff] [blame] | 62 | |
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 63 | /DISCARD/ : { *(.rela.plt*) } |
64 | .rela.dyn : { | ||||
65 | __rel_dyn_start = .; | ||||
66 | *(.rela*) | ||||
67 | __rel_dyn_end = .; | ||||
68 | } | ||||
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 69 | |
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 70 | . = ALIGN(4); |
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 71 | |
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 72 | .dynsym : { |
73 | __dyn_sym_start = .; | ||||
74 | *(.dynsym) | ||||
75 | __dyn_sym_end = .; | ||||
76 | } | ||||
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 77 | |
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 78 | . = ALIGN(4); |
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 79 | |
80 | _end = .; | ||||
81 | |||||
82 | .bss : { | ||||
Bin Meng | c7feb19 | 2018-09-26 06:55:12 -0700 | [diff] [blame] | 83 | __bss_start = .; |
84 | *(.bss*) | ||||
Rick Chen | 55bc1bd | 2019-11-14 13:52:27 +0800 | [diff] [blame^] | 85 | . = ALIGN(8); |
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 86 | __bss_end = .; |
87 | } | ||||
Rick Chen | e76b804 | 2017-12-26 13:55:48 +0800 | [diff] [blame] | 88 | } |