Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-2-Clause */ |
Simon Glass | 672e82c | 2015-08-04 12:33:51 -0600 | [diff] [blame] | 2 | /* |
| 3 | * U-Boot EFI linker script |
| 4 | * |
Simon Glass | 672e82c | 2015-08-04 12:33:51 -0600 | [diff] [blame] | 5 | * Modified from usr/lib32/elf_x86_64_efi.lds in gnu-efi |
| 6 | */ |
| 7 | |
Simon Glass | 672e82c | 2015-08-04 12:33:51 -0600 | [diff] [blame] | 8 | OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") |
| 9 | OUTPUT_ARCH(i386:x86-64) |
| 10 | ENTRY(_start) |
| 11 | SECTIONS |
| 12 | { |
| 13 | image_base = .; |
| 14 | .hash : { *(.hash) } /* this MUST come first, EFI expects it */ |
| 15 | . = ALIGN(4096); |
| 16 | .eh_frame : { |
| 17 | *(.eh_frame) |
| 18 | } |
| 19 | |
| 20 | . = ALIGN(4096); |
| 21 | |
| 22 | .text : { |
| 23 | *(.text) |
| 24 | *(.text.*) |
| 25 | *(.gnu.linkonce.t.*) |
| 26 | } |
| 27 | |
| 28 | . = ALIGN(4096); |
| 29 | |
| 30 | .reloc : { |
| 31 | *(.reloc) |
| 32 | } |
| 33 | |
| 34 | . = ALIGN(4096); |
| 35 | |
| 36 | .data : { |
| 37 | *(.rodata*) |
| 38 | *(.got.plt) |
| 39 | *(.got) |
| 40 | *(.data*) |
| 41 | *(.sdata) |
| 42 | /* the EFI loader doesn't seem to like a .bss section, so we stick |
| 43 | * it all into .data: */ |
| 44 | *(.sbss) |
| 45 | *(.scommon) |
| 46 | *(.dynbss) |
Alexander Graf | 61c7678 | 2018-08-20 14:17:41 +0200 | [diff] [blame] | 47 | *(.bss*) |
Simon Glass | 672e82c | 2015-08-04 12:33:51 -0600 | [diff] [blame] | 48 | *(COMMON) |
| 49 | *(.rel.local) |
| 50 | |
| 51 | /* U-Boot lists and device tree */ |
| 52 | . = ALIGN(8); |
Andrew Scull | 5a9095c | 2022-05-30 10:00:04 +0000 | [diff] [blame] | 53 | *(SORT(__u_boot_list*)); |
Simon Glass | 672e82c | 2015-08-04 12:33:51 -0600 | [diff] [blame] | 54 | . = ALIGN(8); |
| 55 | *(.dtb*); |
| 56 | } |
| 57 | |
| 58 | . = ALIGN(4096); |
| 59 | .dynamic : { *(.dynamic) } |
| 60 | . = ALIGN(4096); |
| 61 | |
| 62 | .rela : { |
| 63 | *(.rela.data*) |
| 64 | *(.rela.got) |
| 65 | *(.rela.stab) |
Andrew Scull | 5a9095c | 2022-05-30 10:00:04 +0000 | [diff] [blame] | 66 | *(.rela__u_boot_list*) |
Simon Glass | 672e82c | 2015-08-04 12:33:51 -0600 | [diff] [blame] | 67 | } |
| 68 | |
| 69 | . = ALIGN(4096); |
| 70 | .dynsym : { *(.dynsym) } |
| 71 | . = ALIGN(4096); |
| 72 | .dynstr : { *(.dynstr) } |
| 73 | . = ALIGN(4096); |
Simon Glass | f12a263 | 2022-01-04 03:51:14 -0700 | [diff] [blame] | 74 | |
| 75 | /DISCARD/ : { *(.eh_frame) } |
| 76 | |
Simon Glass | 672e82c | 2015-08-04 12:33:51 -0600 | [diff] [blame] | 77 | .ignored.reloc : { |
| 78 | *(.rela.reloc) |
Simon Glass | 672e82c | 2015-08-04 12:33:51 -0600 | [diff] [blame] | 79 | *(.note.GNU-stack) |
| 80 | } |
| 81 | |
| 82 | .comment 0 : { *(.comment) } |
| 83 | } |