Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
Simon Glass | fc03fb9 | 2016-11-07 08:47:10 -0700 | [diff] [blame] | 2 | /* |
| 3 | * U-Boot ARM EFI linker script |
| 4 | * |
Simon Glass | fc03fb9 | 2016-11-07 08:47:10 -0700 | [diff] [blame] | 5 | * Modified from elf_arm_efi.lds in gnu-efi |
| 6 | */ |
| 7 | |
| 8 | OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") |
| 9 | OUTPUT_ARCH(arm) |
Heinrich Schuchardt | 7e9a00e | 2024-02-26 22:24:08 +0100 | [diff] [blame] | 10 | |
| 11 | PHDRS |
| 12 | { |
| 13 | data PT_LOAD FLAGS(3); /* PF_W | PF_X */ |
| 14 | } |
| 15 | |
Simon Glass | fc03fb9 | 2016-11-07 08:47:10 -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 | 7e9a00e | 2024-02-26 22:24:08 +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 | fc03fb9 | 2016-11-07 08:47:10 -0700 | [diff] [blame] | 30 | } |
| 31 | _etext = .; |
| 32 | _text_size = . - _text; |
Heinrich Schuchardt | 7e9a00e | 2024-02-26 22:24:08 +0100 | [diff] [blame] | 33 | . = ALIGN(4096); |
Simon Glass | fc03fb9 | 2016-11-07 08:47:10 -0700 | [diff] [blame] | 34 | .data : { |
| 35 | _data = .; |
| 36 | *(.sdata) |
| 37 | *(.data) |
| 38 | *(.data1) |
| 39 | *(.data.*) |
| 40 | *(.got.plt) |
| 41 | *(.got) |
| 42 | |
| 43 | /* |
| 44 | * The EFI loader doesn't seem to like a .bss section, so we |
| 45 | * stick it all into .data: |
| 46 | */ |
| 47 | . = ALIGN(16); |
| 48 | _bss = .; |
| 49 | *(.sbss) |
| 50 | *(.scommon) |
| 51 | *(.dynbss) |
| 52 | *(.bss) |
| 53 | *(.bss.*) |
| 54 | *(COMMON) |
Heinrich Schuchardt | f263479 | 2022-01-14 21:40:15 +0100 | [diff] [blame] | 55 | . = ALIGN(512); |
Simon Glass | fc03fb9 | 2016-11-07 08:47:10 -0700 | [diff] [blame] | 56 | _bss_end = .; |
| 57 | _edata = .; |
Heinrich Schuchardt | 7e9a00e | 2024-02-26 22:24:08 +0100 | [diff] [blame] | 58 | } :data |
| 59 | _data_size = . - _data; |
Simon Glass | fc03fb9 | 2016-11-07 08:47:10 -0700 | [diff] [blame] | 60 | |
Simon Glass | fc03fb9 | 2016-11-07 08:47:10 -0700 | [diff] [blame] | 61 | /DISCARD/ : { |
Heinrich Schuchardt | 7e9a00e | 2024-02-26 22:24:08 +0100 | [diff] [blame] | 62 | /* |
| 63 | * We don't support relocations. These would have to be |
| 64 | * translated from ELF to PE format and added to the .reloc |
| 65 | * section. |
| 66 | */ |
| 67 | *(.rel.dyn) |
| 68 | *(.rel.plt) |
| 69 | *(.rel.got) |
| 70 | *(.rel.data) |
| 71 | *(.rel.data*) |
Simon Glass | fc03fb9 | 2016-11-07 08:47:10 -0700 | [diff] [blame] | 72 | *(.rel.reloc) |
| 73 | *(.eh_frame) |
| 74 | *(.note.GNU-stack) |
Alexander Graf | 71acd4f | 2017-12-11 09:45:30 +0100 | [diff] [blame] | 75 | *(.dynsym) |
| 76 | *(.dynstr) |
| 77 | *(.note.gnu.build-id) |
| 78 | *(.comment) |
Simon Glass | fc03fb9 | 2016-11-07 08:47:10 -0700 | [diff] [blame] | 79 | } |
Simon Glass | fc03fb9 | 2016-11-07 08:47:10 -0700 | [diff] [blame] | 80 | } |