xref: /DragonStub/gnuefi/elf_ia32_efi.lds (revision f1de0317e130286d7363f30f4f92961ab62fe191)
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   *(.plt)
21   . = ALIGN(16);
22  }
23  _etext = .;
24  _text_size = _etext - _text;
25  . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
26  .data :
27  {
28   _data = .;
29   *(.got.plt)
30   *(.got)
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  . = ALIGN(4096);
92  .rodata : { *(.rodata*) }
93  _edata = .;
94  _data_size = _edata - _etext;
95  . = ALIGN(4096);
96  .reloc :		/* This is the PECOFF .reloc section! */
97  {
98    KEEP (*(.reloc))
99  }
100  . = ALIGN(4096);
101  .dynsym   : { *(.dynsym) }
102  . = ALIGN(4096);
103  .dynstr   : { *(.dynstr) }
104  . = ALIGN(4096);
105  . = DATA_SEGMENT_END (.);
106  /DISCARD/ :
107  {
108    *(.rel.reloc)
109    *(.note.GNU-stack)
110  }
111  .comment 0 : { *(.comment) }
112}
113