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); |
| 53 | *(SORT(.u_boot_list*)); |
| 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) |
| 66 | } |
| 67 | |
| 68 | . = ALIGN(4096); |
| 69 | .dynsym : { *(.dynsym) } |
| 70 | . = ALIGN(4096); |
| 71 | .dynstr : { *(.dynstr) } |
| 72 | . = ALIGN(4096); |
| 73 | .ignored.reloc : { |
| 74 | *(.rela.reloc) |
| 75 | *(.eh_frame) |
| 76 | *(.note.GNU-stack) |
| 77 | } |
| 78 | |
| 79 | .comment 0 : { *(.comment) } |
| 80 | } |