xref: /DragonStub/gnuefi/elf_aarch64_efi.lds (revision 4f8b339facb471192e021fffd5db545a0fbddbc3)
1OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64")
2OUTPUT_ARCH(aarch64)
3ENTRY(_start)
4SECTIONS
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   /*
45    * Note that these aren't the using the GNU "CONSTRUCTOR" output section
46    * command, so they don't start with a size.  Because of p2align and the
47    * end/END definitions, and the fact that they're mergeable, they can also
48    * have NULLs which aren't guaranteed to be at the end.
49    */
50   . = ALIGN(16);
51   _init_array = .;
52   *(SORT_BY_NAME(.init_array))
53   _init_array_end = .;
54   __CTOR_LIST__ = .;
55   *(SORT_BY_NAME(.ctors))
56   __CTOR_END__ = .;
57   __DTOR_LIST__ = .;
58   *(SORT_BY_NAME(.dtors))
59   __DTOR_END__ = .;
60   _fini_array = .;
61   *(SORT_BY_NAME(.fini_array))
62   _fini_array_end = .;
63
64   /* the EFI loader doesn't seem to like a .bss section, so we stick
65      it all into .data: */
66   . = ALIGN(16);
67   _bss = .;
68   *(.sbss)
69   *(.scommon)
70   *(.dynbss)
71   *(.bss*)
72   *(COMMON)
73   *(.rel.local)
74   . = ALIGN(16);
75
76   _bss_end = .;
77  }
78
79  . = ALIGN(4096);
80  .rela :
81  {
82    *(.rela.text*)
83    *(.rela.data*)
84    *(.rela.got)
85    *(.rela.dyn)
86    *(.rela.stab)
87  }
88  . = ALIGN(4096);
89  .rela.plt : { *(.rela.plt) }
90  . = ALIGN(512);
91  _edata = .;
92  _data_size = . - _data;
93
94  . = ALIGN(4096);
95  .dynsym   : { *(.dynsym) }
96  . = ALIGN(4096);
97  .dynstr   : { *(.dynstr) }
98  . = ALIGN(4096);
99  .note.gnu.build-id : { *(.note.gnu.build-id) }
100  .ignored.reloc :
101  {
102    *(.rela.reloc)
103    *(.note.GNU-stack)
104  }
105  .comment 0 : { *(.comment) }
106}
107