blob: c3e0d20d5774e955995d8068ccebca9cd974d984 [file] [log] [blame]
Rick Chen9dbb9732018-05-29 14:10:06 +08001/* SPDX-License-Identifier: GPL-2.0+ */
Alexander Graf31bdde92018-04-23 07:59:45 +02002/*
3 * U-Boot riscv32 EFI linker script
4 *
5 * SPDX-License-Identifier: BSD-2-Clause
6 *
7 * Modified from arch/arm/lib/elf_aarch64_efi.lds
8 */
9
10OUTPUT_FORMAT("elf32-littleriscv", "elf32-littleriscv", "elf32-littleriscv")
11OUTPUT_ARCH(riscv)
12ENTRY(_start)
13SECTIONS
14{
15 .text 0x0 : {
16 _text = .;
17 *(.text.head)
18 *(.text)
19 *(.text.*)
20 *(.gnu.linkonce.t.*)
21 *(.srodata)
22 *(.rodata*)
Heinrich Schuchardtf2634792022-01-14 21:40:15 +010023 . = ALIGN(512);
Alexander Graf31bdde92018-04-23 07:59:45 +020024 }
25 _etext = .;
26 _text_size = . - _text;
27 .dynamic : { *(.dynamic) }
28 .data : {
29 _data = .;
30 *(.sdata)
31 *(.data)
32 *(.data1)
33 *(.data.*)
34 *(.got.plt)
35 *(.got)
36
37 /*
38 * The EFI loader doesn't seem to like a .bss section, so we
39 * stick it all into .data:
40 */
41 . = ALIGN(16);
42 _bss = .;
43 *(.sbss)
44 *(.scommon)
45 *(.dynbss)
46 *(.bss)
47 *(.bss.*)
48 *(COMMON)
Heinrich Schuchardtf2634792022-01-14 21:40:15 +010049 . = ALIGN(512);
Alexander Graf31bdde92018-04-23 07:59:45 +020050 _bss_end = .;
51 _edata = .;
52 }
53 .rela.dyn : { *(.rela.dyn) }
54 .rela.plt : { *(.rela.plt) }
55 .rela.got : { *(.rela.got) }
56 .rela.data : { *(.rela.data) *(.rela.data*) }
57 _data_size = . - _etext;
58
59 . = ALIGN(4096);
60 .dynsym : { *(.dynsym) }
61 . = ALIGN(4096);
62 .dynstr : { *(.dynstr) }
63 . = ALIGN(4096);
64 .note.gnu.build-id : { *(.note.gnu.build-id) }
65 /DISCARD/ : {
66 *(.rel.reloc)
67 *(.eh_frame)
68 *(.note.GNU-stack)
69 }
70 .comment 0 : { *(.comment) }
71}