xref: /DragonStub/gnuefi/elf_x86_64_efi.lds (revision 9835e11ebe95ed8372ac2a6671de07cc970cdee0)
1/* Same as elf_x86_64_fbsd_efi.lds, except for OUTPUT_FORMAT below - KEEP IN SYNC */
2OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
3OUTPUT_ARCH(i386:x86-64)
4ENTRY(_start)
5SECTIONS
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   . = ALIGN(16);
23  }
24  _etext = .;
25  _text_size = . - _text;
26  . = ALIGN(4096);
27  .reloc :
28  {
29   KEEP (*(.reloc))
30  }
31
32  . = ALIGN(4096);
33  .data :
34  {
35   _data = .;
36   *(.rodata*)
37   *(.got.plt)
38   *(.got)
39   *(.data*)
40   *(.sdata)
41
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
69   /* the EFI loader doesn't seem to like a .bss section, so we stick
70      it all into .data: */
71   *(.sbss)
72   *(.scommon)
73   *(.dynbss)
74   *(.bss*)
75   *(COMMON)
76   *(.rel.local)
77  }
78  .note.gnu.build-id : { *(.note.gnu.build-id) }
79
80  _edata = .;
81  _data_size = . - _etext;
82  . = ALIGN(4096);
83  .dynamic  : { *(.dynamic) }
84  . = ALIGN(4096);
85  .rela :
86  {
87    *(.rela.text*)
88    *(.rela.data*)
89    *(.rela.got)
90    *(.rela.dyn)
91    *(.rela.stab)
92    *(.rela.init_array*)
93    *(.rela.fini_array*)
94    *(.rela.ctors*)
95    *(.rela.dtors*)
96  }
97  . = ALIGN(4096);
98  .rela.plt : { *(.rela.plt) }
99  . = ALIGN(4096);
100  .dynsym   : { *(.dynsym) }
101  . = ALIGN(4096);
102  .dynstr   : { *(.dynstr) }
103  . = ALIGN(4096);
104  .ignored.reloc :
105  {
106    *(.rela.reloc)
107    *(.note.GNU-stack)
108  }
109  .comment 0 : { *(.comment) }
110}
111