elf_x86_64_efi.lds 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. *(.plt)
  23. . = ALIGN(16);
  24. }
  25. _etext = .;
  26. _text_size = _etext - _text;
  27. . = ALIGN(4096);
  28. .reloc :
  29. {
  30. KEEP (*(.reloc))
  31. }
  32. . = ALIGN(4096);
  33. .data :
  34. {
  35. _data = .;
  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_start = .;
  48. *(SORT(.init_array.*))
  49. *(.init_array)
  50. __init_array_end = .;
  51. . = ALIGN(16);
  52. __CTOR_LIST__ = .;
  53. *(SORT(.ctors.*))
  54. *(.ctors)
  55. __CTOR_END__ = .;
  56. . = ALIGN(16);
  57. __DTOR_LIST__ = .;
  58. *(SORT(.dtors.*))
  59. *(.dtors)
  60. __DTOR_END__ = .;
  61. . = ALIGN(16);
  62. __fini_array_start = .;
  63. *(SORT(.fini_array.*))
  64. *(.fini_array)
  65. __fini_array_end = .;
  66. /* the EFI loader doesn't seem to like a .bss section, so we stick
  67. it all into .data: */
  68. *(.sbss)
  69. *(.scommon)
  70. *(.dynbss)
  71. *(.bss*)
  72. *(COMMON)
  73. *(.rel.local)
  74. }
  75. .note.gnu.build-id : { *(.note.gnu.build-id) }
  76. _edata = .;
  77. _data_size = _edata - _etext;
  78. . = ALIGN(4096);
  79. .dynamic : { *(.dynamic) }
  80. . = ALIGN(4096);
  81. .rela :
  82. {
  83. *(.rela.text*)
  84. *(.rela.data*)
  85. *(.rela.got)
  86. *(.rela.dyn)
  87. *(.rela.stab)
  88. *(.rela.init_array*)
  89. *(.rela.fini_array*)
  90. *(.rela.ctors*)
  91. *(.rela.dtors*)
  92. }
  93. . = ALIGN(4096);
  94. .rela.plt : { *(.rela.plt) }
  95. . = ALIGN(4096);
  96. .rodata : { *(.rodata*) }
  97. . = ALIGN(4096);
  98. .dynsym : { *(.dynsym) }
  99. . = ALIGN(4096);
  100. .dynstr : { *(.dynstr) }
  101. . = ALIGN(4096);
  102. .ignored.reloc :
  103. {
  104. *(.rela.reloc)
  105. *(.note.GNU-stack)
  106. }
  107. .comment 0 : { *(.comment) }
  108. }