elf_x86_64_efi.lds 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* SPDX-License-Identifier: BSD-2-Clause */
  2. /*
  3. * U-Boot EFI linker script
  4. *
  5. * Modified from usr/lib32/elf_x86_64_efi.lds in gnu-efi
  6. */
  7. OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
  8. OUTPUT_ARCH(i386:x86-64)
  9. ENTRY(_start)
  10. SECTIONS
  11. {
  12. image_base = .;
  13. .hash : { *(.hash) } /* this MUST come first, EFI expects it */
  14. . = ALIGN(4096);
  15. .eh_frame : {
  16. *(.eh_frame)
  17. }
  18. . = ALIGN(4096);
  19. .text : {
  20. *(.text)
  21. *(.text.*)
  22. *(.gnu.linkonce.t.*)
  23. }
  24. . = ALIGN(4096);
  25. .reloc : {
  26. *(.reloc)
  27. }
  28. . = ALIGN(4096);
  29. .data : {
  30. *(.rodata*)
  31. *(.got.plt)
  32. *(.got)
  33. *(.data*)
  34. *(.sdata)
  35. /* the EFI loader doesn't seem to like a .bss section, so we stick
  36. * it all into .data: */
  37. *(.sbss)
  38. *(.scommon)
  39. *(.dynbss)
  40. *(.bss*)
  41. *(COMMON)
  42. *(.rel.local)
  43. /* U-Boot lists and device tree */
  44. . = ALIGN(8);
  45. *(SORT(.u_boot_list*));
  46. . = ALIGN(8);
  47. *(.dtb*);
  48. }
  49. . = ALIGN(4096);
  50. .dynamic : { *(.dynamic) }
  51. . = ALIGN(4096);
  52. .rela : {
  53. *(.rela.data*)
  54. *(.rela.got)
  55. *(.rela.stab)
  56. }
  57. . = ALIGN(4096);
  58. .dynsym : { *(.dynsym) }
  59. . = ALIGN(4096);
  60. .dynstr : { *(.dynstr) }
  61. . = ALIGN(4096);
  62. .ignored.reloc : {
  63. *(.rela.reloc)
  64. *(.eh_frame)
  65. *(.note.GNU-stack)
  66. }
  67. .comment 0 : { *(.comment) }
  68. }