elf_aarch64_efi.lds 2.3 KB

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