xref: /DragonStub/gnuefi/elf_ia32_efi.lds (revision 8abf159da65fe091017eaa69bc2c04a1403f342a)
1530d68baSNigel CroxonOUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
2530d68baSNigel CroxonOUTPUT_ARCH(i386)
3530d68baSNigel CroxonENTRY(_start)
4530d68baSNigel CroxonSECTIONS
5530d68baSNigel Croxon{
6530d68baSNigel Croxon  . = 0;
7530d68baSNigel Croxon  ImageBase = .;
82cc0b085SSergei Trofimovich  /* .hash and/or .gnu.hash MUST come first! */
92cc0b085SSergei Trofimovich  .hash : { *(.hash) }
102cc0b085SSergei Trofimovich  .gnu.hash : { *(.gnu.hash) }
1115f10734SCallum Farmer  .eh_frame : { *(.eh_frame) }
1215f10734SCallum Farmer  .gcc_except_table : { *(.gcc_except_table*) }
13530d68baSNigel Croxon  . = ALIGN(4096);
14530d68baSNigel Croxon  .text :
15530d68baSNigel Croxon  {
1611a459baSNigel Croxon   _text = .;
17530d68baSNigel Croxon   *(.text)
18530d68baSNigel Croxon   *(.text.*)
19530d68baSNigel Croxon   *(.gnu.linkonce.t.*)
20*8abf159dSCallum Farmer   *(.plt)
2111a459baSNigel Croxon   . = ALIGN(16);
22530d68baSNigel Croxon  }
2311a459baSNigel Croxon  _etext = .;
2420110935SCallum Farmer  _text_size = _etext - _text;
25231c7632SCallum Farmer  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
26bf6fd040SCallum Farmer  .data :
27530d68baSNigel Croxon  {
2811a459baSNigel Croxon   _data = .;
29530d68baSNigel Croxon   *(.got.plt)
30530d68baSNigel Croxon   *(.got)
31530d68baSNigel Croxon   *(.data)
32530d68baSNigel Croxon   *(.data1)
33530d68baSNigel Croxon   *(.data.*)
344f8b339fSPeter Jones
354f8b339fSPeter Jones   /*
364f8b339fSPeter Jones    * Note that these aren't the using the GNU "CONSTRUCTOR" output section
374f8b339fSPeter Jones    * command, so they don't start with a size.  Because of p2align and the
384f8b339fSPeter Jones    * end/END definitions, and the fact that they're mergeable, they can also
394f8b339fSPeter Jones    * have NULLs which aren't guaranteed to be at the end.
404f8b339fSPeter Jones    */
414f8b339fSPeter Jones   . = ALIGN(16);
429c5403e1SCallum Farmer   __init_array_start = .;
43e2aa0997SCallum Farmer   *(SORT(.init_array.*))
44e2aa0997SCallum Farmer   *(.init_array)
459c5403e1SCallum Farmer   __init_array_end = .;
469dbfe1c3SCallum Farmer  . = ALIGN(16);
474f8b339fSPeter Jones   __CTOR_LIST__ = .;
48e2aa0997SCallum Farmer   *(SORT(.ctors.*))
49e2aa0997SCallum Farmer   *(.ctors)
504f8b339fSPeter Jones   __CTOR_END__ = .;
519dbfe1c3SCallum Farmer  . = ALIGN(16);
524f8b339fSPeter Jones   __DTOR_LIST__ = .;
53e2aa0997SCallum Farmer   *(SORT(.dtors.*))
54e2aa0997SCallum Farmer   *(.dtors)
554f8b339fSPeter Jones   __DTOR_END__ = .;
569dbfe1c3SCallum Farmer   . = ALIGN(16);
579c5403e1SCallum Farmer   __fini_array_start = .;
58e2aa0997SCallum Farmer   *(SORT(.fini_array.*))
59e2aa0997SCallum Farmer   *(.fini_array)
609c5403e1SCallum Farmer   __fini_array_end = .;
614f8b339fSPeter Jones
62530d68baSNigel Croxon   /* the EFI loader doesn't seem to like a .bss section, so we stick
63530d68baSNigel Croxon      it all into .data: */
64530d68baSNigel Croxon   *(.dynbss)
6515f10734SCallum Farmer   *(.bss*)
66530d68baSNigel Croxon   *(COMMON)
67530d68baSNigel Croxon  }
68d39106b3SNigel Croxon  .note.gnu.build-id : { *(.note.gnu.build-id) }
69d39106b3SNigel Croxon
70530d68baSNigel Croxon  . = ALIGN(4096);
71530d68baSNigel Croxon  .dynamic  : { *(.dynamic) }
72530d68baSNigel Croxon  . = ALIGN(4096);
73530d68baSNigel Croxon  .rel :
74530d68baSNigel Croxon  {
75eea6d31aSCallum Farmer    *(.rel.text*)
76eea6d31aSCallum Farmer    *(.rel.data*)
77530d68baSNigel Croxon    *(.rel.got)
7802f96e8aSCallum Farmer    *(.rel.dyn)
79530d68baSNigel Croxon    *(.rel.stab)
80e2aa0997SCallum Farmer    *(.rel.init_array*)
81e2aa0997SCallum Farmer    *(.rel.fini_array*)
82e2aa0997SCallum Farmer    *(.rel.ctors*)
83e2aa0997SCallum Farmer    *(.rel.dtors*)
84530d68baSNigel Croxon    *(.data.rel.ro.local)
85530d68baSNigel Croxon    *(.data.rel.local)
86530d68baSNigel Croxon    *(.data.rel.ro)
87530d68baSNigel Croxon    *(.data.rel*)
88530d68baSNigel Croxon  }
891a10c661SCallum Farmer  . = ALIGN(4096);
901a10c661SCallum Farmer  .rel.plt : { *(.rel.plt) }
91b3e80c38SCallum Farmer  . = ALIGN(4096);
92b3e80c38SCallum Farmer  .rodata : { *(.rodata*) }
9311a459baSNigel Croxon  _edata = .;
9420110935SCallum Farmer  _data_size = _edata - _etext;
95530d68baSNigel Croxon  . = ALIGN(4096);
96530d68baSNigel Croxon  .reloc :		/* This is the PECOFF .reloc section! */
97530d68baSNigel Croxon  {
98bc233a7aSCallum Farmer    KEEP (*(.reloc))
99530d68baSNigel Croxon  }
100530d68baSNigel Croxon  . = ALIGN(4096);
101530d68baSNigel Croxon  .dynsym   : { *(.dynsym) }
102530d68baSNigel Croxon  . = ALIGN(4096);
103530d68baSNigel Croxon  .dynstr   : { *(.dynstr) }
104530d68baSNigel Croxon  . = ALIGN(4096);
105231c7632SCallum Farmer  . = DATA_SEGMENT_END (.);
106530d68baSNigel Croxon  /DISCARD/ :
107530d68baSNigel Croxon  {
108530d68baSNigel Croxon    *(.rel.reloc)
109530d68baSNigel Croxon    *(.note.GNU-stack)
110530d68baSNigel Croxon  }
111530d68baSNigel Croxon  .comment 0 : { *(.comment) }
112530d68baSNigel Croxon}
113