Rick Chen | 9dbb973 | 2018-05-29 14:10:06 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Alexander Graf | 31bdde9 | 2018-04-23 07:59:45 +0200 | [diff] [blame] | 2 | /* |
| 3 | * U-Boot riscv64 EFI linker script |
| 4 | * |
| 5 | * SPDX-License-Identifier: BSD-2-Clause |
| 6 | * |
| 7 | * Modified from arch/arm/lib/elf_aarch64_efi.lds |
| 8 | */ |
| 9 | |
| 10 | OUTPUT_FORMAT("elf64-littleriscv", "elf64-littleriscv", "elf64-littleriscv") |
| 11 | OUTPUT_ARCH(riscv) |
| 12 | ENTRY(_start) |
| 13 | SECTIONS |
| 14 | { |
| 15 | .text 0x0 : { |
| 16 | _text = .; |
| 17 | *(.text.head) |
| 18 | *(.text) |
| 19 | *(.text.*) |
| 20 | *(.gnu.linkonce.t.*) |
| 21 | *(.srodata) |
| 22 | *(.rodata*) |
Heinrich Schuchardt | f263479 | 2022-01-14 21:40:15 +0100 | [diff] [blame] | 23 | . = ALIGN(512); |
Alexander Graf | 31bdde9 | 2018-04-23 07:59:45 +0200 | [diff] [blame] | 24 | } |
| 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 Schuchardt | f263479 | 2022-01-14 21:40:15 +0100 | [diff] [blame] | 49 | . = ALIGN(512); |
Alexander Graf | 31bdde9 | 2018-04-23 07:59:45 +0200 | [diff] [blame] | 50 | _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 | } |