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