Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
Simon Glass | 61378fd | 2016-11-07 08:47:11 -0700 | [diff] [blame] | 2 | /* |
| 3 | * U-Boot aarch64 EFI linker script |
| 4 | * |
Simon Glass | 61378fd | 2016-11-07 08:47:11 -0700 | [diff] [blame] | 5 | * Modified from elf_aarch64_efi.lds in gnu-efi |
| 6 | */ |
| 7 | |
| 8 | OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64") |
| 9 | OUTPUT_ARCH(aarch64) |
Heinrich Schuchardt | 4936ff9 | 2023-01-04 23:43:08 +0100 | [diff] [blame] | 10 | |
| 11 | PHDRS |
| 12 | { |
| 13 | data PT_LOAD FLAGS(3); /* SHF_WRITE | SHF_ALLOC */ |
| 14 | } |
| 15 | |
Simon Glass | 61378fd | 2016-11-07 08:47:11 -0700 | [diff] [blame] | 16 | ENTRY(_start) |
| 17 | SECTIONS |
| 18 | { |
| 19 | .text 0x0 : { |
| 20 | _text = .; |
| 21 | *(.text.head) |
| 22 | *(.text) |
| 23 | *(.text.*) |
| 24 | *(.gnu.linkonce.t.*) |
| 25 | *(.srodata) |
| 26 | *(.rodata*) |
Heinrich Schuchardt | 7b298a5 | 2022-12-31 11:58:54 +0100 | [diff] [blame] | 27 | . = ALIGN(16); |
| 28 | *(.dynamic); |
Heinrich Schuchardt | f263479 | 2022-01-14 21:40:15 +0100 | [diff] [blame] | 29 | . = ALIGN(512); |
Simon Glass | 61378fd | 2016-11-07 08:47:11 -0700 | [diff] [blame] | 30 | } |
Heinrich Schuchardt | cc7ac84 | 2023-01-08 19:00:47 +0100 | [diff] [blame] | 31 | .rela.dyn : { *(.rela.dyn) } |
| 32 | .rela.plt : { *(.rela.plt) } |
| 33 | .rela.got : { *(.rela.got) } |
| 34 | .rela.data : { *(.rela.data) *(.rela.data*) } |
Simon Glass | 61378fd | 2016-11-07 08:47:11 -0700 | [diff] [blame] | 35 | _etext = .; |
| 36 | _text_size = . - _text; |
Heinrich Schuchardt | 7b298a5 | 2022-12-31 11:58:54 +0100 | [diff] [blame] | 37 | . = ALIGN(4096); |
Simon Glass | 61378fd | 2016-11-07 08:47:11 -0700 | [diff] [blame] | 38 | .data : { |
| 39 | _data = .; |
| 40 | *(.sdata) |
| 41 | *(.data) |
| 42 | *(.data1) |
| 43 | *(.data.*) |
| 44 | *(.got.plt) |
| 45 | *(.got) |
| 46 | |
| 47 | /* |
| 48 | * The EFI loader doesn't seem to like a .bss section, so we |
| 49 | * stick it all into .data: |
| 50 | */ |
| 51 | . = ALIGN(16); |
| 52 | _bss = .; |
| 53 | *(.sbss) |
| 54 | *(.scommon) |
| 55 | *(.dynbss) |
| 56 | *(.bss) |
| 57 | *(.bss.*) |
| 58 | *(COMMON) |
Heinrich Schuchardt | f263479 | 2022-01-14 21:40:15 +0100 | [diff] [blame] | 59 | . = ALIGN(512); |
Simon Glass | 61378fd | 2016-11-07 08:47:11 -0700 | [diff] [blame] | 60 | _bss_end = .; |
| 61 | _edata = .; |
Heinrich Schuchardt | 4936ff9 | 2023-01-04 23:43:08 +0100 | [diff] [blame] | 62 | } :data |
Heinrich Schuchardt | 7b298a5 | 2022-12-31 11:58:54 +0100 | [diff] [blame] | 63 | _data_size = _edata - _data; |
Simon Glass | 61378fd | 2016-11-07 08:47:11 -0700 | [diff] [blame] | 64 | |
| 65 | . = ALIGN(4096); |
| 66 | .dynsym : { *(.dynsym) } |
| 67 | . = ALIGN(4096); |
| 68 | .dynstr : { *(.dynstr) } |
| 69 | . = ALIGN(4096); |
| 70 | .note.gnu.build-id : { *(.note.gnu.build-id) } |
| 71 | /DISCARD/ : { |
| 72 | *(.rel.reloc) |
| 73 | *(.eh_frame) |
| 74 | *(.note.GNU-stack) |
| 75 | } |
| 76 | .comment 0 : { *(.comment) } |
| 77 | } |