xref: /DragonStub/gnuefi/elf_x86_64_fbsd_efi.lds (revision 4c938fac30954a54456300bcdad2fdd0b34b6210)
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 = . - _text;
26  .reloc :
27  {
28   *(.reloc)
29  }
30  . = ALIGN(4096);
31  .data :
32  {
33   _data = .;
34   *(.rodata*)
35   *(.got.plt)
36   *(.got)
37   *(.data*)
38   *(.sdata)
39
40   /*
41    * Note that these aren't the using the GNU "CONSTRUCTOR" output section
42    * command, so they don't start with a size.  Because of p2align and the
43    * end/END definitions, and the fact that they're mergeable, they can also
44    * have NULLs which aren't guaranteed to be at the end.
45    */
46   . = ALIGN(16);
47   _init_array = .;
48   *(SORT_BY_NAME(.init_array))
49   _init_array_end = .;
50   __CTOR_LIST__ = .;
51   *(SORT_BY_NAME(.ctors))
52   __CTOR_END__ = .;
53   __DTOR_LIST__ = .;
54   *(SORT_BY_NAME(.dtors))
55   __DTOR_END__ = .;
56   _fini_array = .;
57   *(SORT_BY_NAME(.fini_array))
58   _fini_array_end = .;
59
60   /* the EFI loader doesn't seem to like a .bss section, so we stick
61      it all into .data: */
62   *(.sbss)
63   *(.scommon)
64   *(.dynbss)
65   *(.bss)
66   *(COMMON)
67   *(.rel.local)
68  }
69  .note.gnu.build-id : { *(.note.gnu.build-id) }
70
71  . = ALIGN(4096);
72  .dynamic  : { *(.dynamic) }
73  . = ALIGN(4096);
74  .rela :
75  {
76    *(.rela.data*)
77    *(.rela.got)
78    *(.rela.stab)
79    *(.rela.init_array)
80    *(.rela.fini_array)
81    *(.rela.ctors)
82    *(.rela.dtors)
83  }
84  _edata = .;
85  _data_size = . - _etext;
86  . = ALIGN(4096);
87  .dynsym   : { *(.dynsym) }
88  . = ALIGN(4096);
89  .dynstr   : { *(.dynstr) }
90  . = ALIGN(4096);
91  .ignored.reloc :
92  {
93    *(.rela.reloc)
94  }
95}
96