xref: /DragonStub/gnuefi/elf_x86_64_fbsd_efi.lds (revision 6f333cfc914e7cfacc4d3ef3e034e4483f0ba8b2)
1/* Same as elf_x86_64_efi.lds, except for OUTPUT_FORMAT below - KEEP IN SYNC */
2OUTPUT_FORMAT("elf64-x86-64-freebsd", "elf64-x86-64-freebsd", "elf64-x86-64-freebsd")
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 :
14  {
15    *(.eh_frame)
16  }
17  . = ALIGN(4096);
18  .text :
19  {
20   _text = .;
21   *(.text)
22   . = ALIGN(16);
23  }
24  _etext = .;
25  _text_size = _etext - _text;
26  .reloc :
27  {
28   *(.reloc)
29  }
30  . = ALIGN(4096);
31  .data :
32  {
33   _data = .;
34   *(.got.plt)
35   *(.got)
36   *(.data*)
37   *(.sdata)
38
39   /*
40    * Note that these aren't the using the GNU "CONSTRUCTOR" output section
41    * command, so they don't start with a size.  Because of p2align and the
42    * end/END definitions, and the fact that they're mergeable, they can also
43    * have NULLs which aren't guaranteed to be at the end.
44    */
45   . = ALIGN(16);
46   __init_array_start = .;
47   *(SORT(.init_array.*))
48   *(.init_array)
49   __init_array_end = .;
50  . = ALIGN(16);
51   __CTOR_LIST__ = .;
52   *(SORT(.ctors.*))
53   *(.ctors)
54   __CTOR_END__ = .;
55  . = ALIGN(16);
56   __DTOR_LIST__ = .;
57   *(SORT(.dtors.*))
58   *(.dtors)
59   __DTOR_END__ = .;
60   . = ALIGN(16);
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  . = ALIGN(4096);
78  .dynamic  : { *(.dynamic) }
79  . = ALIGN(4096);
80  .rela :
81  {
82    *(.rela.data*)
83    *(.rela.got)
84    *(.rela.stab)
85    *(.rela.init_array*)
86    *(.rela.fini_array*)
87    *(.rela.ctors*)
88    *(.rela.dtors*)
89  }
90  . = ALIGN(4096);
91  .rodata : { *(.rodata*) }
92  _edata = .;
93  _data_size = _edata - _etext;
94  . = ALIGN(4096);
95  .dynsym   : { *(.dynsym) }
96  . = ALIGN(4096);
97  .dynstr   : { *(.dynstr) }
98  . = ALIGN(4096);
99  .ignored.reloc :
100  {
101    *(.rela.reloc)
102  }
103}
104