xref: /DragonStub/gnuefi/elf_x86_64_efi.lds (revision 8abf159da65fe091017eaa69bc2c04a1403f342a)
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   *(.plt)
23   . = ALIGN(16);
24  }
25  _etext = .;
26  _text_size = _etext - _text;
27  . = ALIGN(4096);
28  .reloc :
29  {
30   KEEP (*(.reloc))
31  }
32
33  . = ALIGN(4096);
34  .data :
35  {
36   _data = .;
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 = _edata - _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  .rodata : { *(.rodata*) }
101  . = ALIGN(4096);
102  .dynsym   : { *(.dynsym) }
103  . = ALIGN(4096);
104  .dynstr   : { *(.dynstr) }
105  . = ALIGN(4096);
106  .ignored.reloc :
107  {
108    *(.rela.reloc)
109    *(.note.GNU-stack)
110  }
111  .comment 0 : { *(.comment) }
112}
113