elf_x86_64_efi.lds 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* Same as elf_x86_64_fbsd_efi.lds, except for OUTPUT_FORMAT below - KEEP IN SYNC */
  2. OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
  3. OUTPUT_ARCH(i386:x86-64)
  4. ENTRY(_start)
  5. SECTIONS
  6. {
  7. . = 0;
  8. ImageBase = .;
  9. /* .hash and/or .gnu.hash MUST come first! */
  10. .hash : { *(.hash) }
  11. .gnu.hash : { *(.gnu.hash) }
  12. . = ALIGN(4096);
  13. .eh_frame : { *(.eh_frame) }
  14. .gcc_except_table : { *(.gcc_except_table*) }
  15. . = ALIGN(4096);
  16. .text :
  17. {
  18. _text = .;
  19. *(.text)
  20. *(.text.*)
  21. *(.gnu.linkonce.t.*)
  22. . = ALIGN(16);
  23. }
  24. _etext = .;
  25. _text_size = . - _text;
  26. . = ALIGN(4096);
  27. .reloc :
  28. {
  29. KEEP (*(.reloc))
  30. }
  31. . = ALIGN(4096);
  32. .data :
  33. {
  34. _data = .;
  35. *(.rodata*)
  36. *(.got.plt)
  37. *(.got)
  38. *(.data*)
  39. *(.sdata)
  40. /*
  41. * Note that these aren't the using the GNU "CONSTRUCTOR" output section
  42. * command, so they don't start with a size. Because of p2align and the
  43. * end/END definitions, and the fact that they're mergeable, they can also
  44. * have NULLs which aren't guaranteed to be at the end.
  45. */
  46. . = ALIGN(16);
  47. _init_array = .;
  48. *(SORT_BY_NAME(.init_array))
  49. _init_array_end = .;
  50. __CTOR_LIST__ = .;
  51. *(SORT_BY_NAME(.ctors))
  52. __CTOR_END__ = .;
  53. __DTOR_LIST__ = .;
  54. *(SORT_BY_NAME(.dtors))
  55. __DTOR_END__ = .;
  56. _fini_array = .;
  57. *(SORT_BY_NAME(.fini_array))
  58. _fini_array_end = .;
  59. /* the EFI loader doesn't seem to like a .bss section, so we stick
  60. it all into .data: */
  61. *(.sbss)
  62. *(.scommon)
  63. *(.dynbss)
  64. *(.bss*)
  65. *(COMMON)
  66. *(.rel.local)
  67. }
  68. .note.gnu.build-id : { *(.note.gnu.build-id) }
  69. _edata = .;
  70. _data_size = . - _etext;
  71. . = ALIGN(4096);
  72. .dynamic : { *(.dynamic) }
  73. . = ALIGN(4096);
  74. .rela :
  75. {
  76. *(.rela.text*)
  77. *(.rela.data*)
  78. *(.rela.got)
  79. *(.rela.dyn)
  80. *(.rela.stab)
  81. }
  82. . = ALIGN(4096);
  83. .rela.plt : { *(.rela.plt) }
  84. . = ALIGN(4096);
  85. .dynsym : { *(.dynsym) }
  86. . = ALIGN(4096);
  87. .dynstr : { *(.dynstr) }
  88. . = ALIGN(4096);
  89. .ignored.reloc :
  90. {
  91. *(.rela.reloc)
  92. *(.note.GNU-stack)
  93. }
  94. .comment 0 : { *(.comment) }
  95. }