elf_ia32_efi.lds 1.4 KB

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