elf_aarch64_efi.lds 2.3 KB

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