xref: /DragonStub/gnuefi/elf_aarch64_efi.lds (revision 9c5403e1e6269bd47a4c383cfeaf1a4f29db121f)
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_start = .;
52   *(SORT(.init_array.*))
53   *(.init_array)
54   __init_array_end = .;
55   __CTOR_LIST__ = .;
56   *(SORT(.ctors.*))
57   *(.ctors)
58   __CTOR_END__ = .;
59   __DTOR_LIST__ = .;
60   *(SORT(.dtors.*))
61   *(.dtors)
62   __DTOR_END__ = .;
63   __fini_array_start = .;
64   *(SORT(.fini_array.*))
65   *(.fini_array)
66   __fini_array_end = .;
67
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
80   _bss_end = .;
81  }
82
83  . = ALIGN(4096);
84  .rela :
85  {
86    *(.rela.text*)
87    *(.rela.data*)
88    *(.rela.got)
89    *(.rela.dyn)
90    *(.rela.stab)
91    *(.rela.init_array*)
92    *(.rela.fini_array*)
93    *(.rela.ctors*)
94    *(.rela.dtors*)
95
96  }
97  . = ALIGN(4096);
98  .rela.plt : { *(.rela.plt) }
99  . = ALIGN(512);
100  _edata = .;
101  _data_size = . - _data;
102
103  . = ALIGN(4096);
104  .dynsym   : { *(.dynsym) }
105  . = ALIGN(4096);
106  .dynstr   : { *(.dynstr) }
107  . = ALIGN(4096);
108  .note.gnu.build-id : { *(.note.gnu.build-id) }
109  .ignored.reloc :
110  {
111    *(.rela.reloc)
112    *(.note.GNU-stack)
113  }
114  .comment 0 : { *(.comment) }
115}
116