xref: /DragonStub/gnuefi/elf_ia32_efi.lds (revision 9dbfe1c36558fdbc2574cea7e47e6a473955051d)
1OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
2OUTPUT_ARCH(i386)
3ENTRY(_start)
4SECTIONS
5{
6  . = 0;
7  ImageBase = .;
8  /* .hash and/or .gnu.hash MUST come first! */
9  .hash : { *(.hash) }
10  .gnu.hash : { *(.gnu.hash) }
11  .eh_frame : { *(.eh_frame) }
12  .gcc_except_table : { *(.gcc_except_table*) }
13  . = ALIGN(4096);
14  .text :
15  {
16   _text = .;
17   *(.text)
18   *(.text.*)
19   *(.gnu.linkonce.t.*)
20   . = ALIGN(16);
21  }
22  _etext = .;
23  _text_size = . - _text;
24  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
25  .data :
26  {
27   _data = .;
28   *(.got.plt)
29   *(.got)
30   *(.rodata*)
31   *(.data)
32   *(.data1)
33   *(.data.*)
34
35   /*
36    * Note that these aren't the using the GNU "CONSTRUCTOR" output section
37    * command, so they don't start with a size.  Because of p2align and the
38    * end/END definitions, and the fact that they're mergeable, they can also
39    * have NULLs which aren't guaranteed to be at the end.
40    */
41   . = ALIGN(16);
42   __init_array_start = .;
43   *(SORT(.init_array.*))
44   *(.init_array)
45   __init_array_end = .;
46  . = ALIGN(16);
47   __CTOR_LIST__ = .;
48   *(SORT(.ctors.*))
49   *(.ctors)
50   __CTOR_END__ = .;
51  . = ALIGN(16);
52   __DTOR_LIST__ = .;
53   *(SORT(.dtors.*))
54   *(.dtors)
55   __DTOR_END__ = .;
56   . = ALIGN(16);
57   __fini_array_start = .;
58   *(SORT(.fini_array.*))
59   *(.fini_array)
60   __fini_array_end = .;
61
62   /* the EFI loader doesn't seem to like a .bss section, so we stick
63      it all into .data: */
64   *(.dynbss)
65   *(.bss*)
66   *(COMMON)
67  }
68  .note.gnu.build-id : { *(.note.gnu.build-id) }
69
70  . = ALIGN(4096);
71  .dynamic  : { *(.dynamic) }
72  . = ALIGN(4096);
73  .rel :
74  {
75    *(.rel.text*)
76    *(.rel.data*)
77    *(.rel.got)
78    *(.rel.dyn)
79    *(.rel.stab)
80    *(.rel.init_array*)
81    *(.rel.fini_array*)
82    *(.rel.ctors*)
83    *(.rel.dtors*)
84    *(.data.rel.ro.local)
85    *(.data.rel.local)
86    *(.data.rel.ro)
87    *(.data.rel*)
88  }
89  . = ALIGN(4096);
90  .rel.plt : { *(.rel.plt) }
91  _edata = .;
92  _data_size = . - _etext;
93  . = ALIGN(4096);
94  .reloc :		/* This is the PECOFF .reloc section! */
95  {
96    KEEP (*(.reloc))
97  }
98  . = ALIGN(4096);
99  .dynsym   : { *(.dynsym) }
100  . = ALIGN(4096);
101  .dynstr   : { *(.dynstr) }
102  . = ALIGN(4096);
103  . = DATA_SEGMENT_END (.);
104  /DISCARD/ :
105  {
106    *(.rel.reloc)
107    *(.note.GNU-stack)
108  }
109  .comment 0 : { *(.comment) }
110}
111