xref: /DragonStub/gnuefi/elf_x86_64_efi.lds (revision 9c5403e1e6269bd47a4c383cfeaf1a4f29db121f)
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   __CTOR_LIST__ = .;
54   *(SORT(.ctors.*))
55   *(.ctors)
56   __CTOR_END__ = .;
57   __DTOR_LIST__ = .;
58   *(SORT(.dtors.*))
59   *(.dtors)
60   __DTOR_END__ = .;
61   __fini_array_start = .;
62   *(SORT(.fini_array.*))
63   *(.fini_array)
64   __fini_array_end = .;
65
66   /* the EFI loader doesn't seem to like a .bss section, so we stick
67      it all into .data: */
68   *(.sbss)
69   *(.scommon)
70   *(.dynbss)
71   *(.bss*)
72   *(COMMON)
73   *(.rel.local)
74  }
75  .note.gnu.build-id : { *(.note.gnu.build-id) }
76
77  _edata = .;
78  _data_size = . - _etext;
79  . = ALIGN(4096);
80  .dynamic  : { *(.dynamic) }
81  . = ALIGN(4096);
82  .rela :
83  {
84    *(.rela.text*)
85    *(.rela.data*)
86    *(.rela.got)
87    *(.rela.dyn)
88    *(.rela.stab)
89    *(.rela.init_array*)
90    *(.rela.fini_array*)
91    *(.rela.ctors*)
92    *(.rela.dtors*)
93  }
94  . = ALIGN(4096);
95  .rela.plt : { *(.rela.plt) }
96  . = ALIGN(4096);
97  .dynsym   : { *(.dynsym) }
98  . = ALIGN(4096);
99  .dynstr   : { *(.dynstr) }
100  . = ALIGN(4096);
101  .ignored.reloc :
102  {
103    *(.rela.reloc)
104    *(.note.GNU-stack)
105  }
106  .comment 0 : { *(.comment) }
107}
108