elf_ia32_efi.lds 1.4 KB

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