xref: /DragonStub/gnuefi/elf_ia32_efi.lds (revision e2aa099738e1bd527929b5fb6fe7312962b6b4e4)
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 = .;
43   *(SORT(.init_array.*))
44   *(.init_array)
45   _init_array_end = .;
46   __CTOR_LIST__ = .;
47   *(SORT(.ctors.*))
48   *(.ctors)
49   __CTOR_END__ = .;
50   __DTOR_LIST__ = .;
51   *(SORT(.dtors.*))
52   *(.dtors)
53   __DTOR_END__ = .;
54   _fini_array = .;
55   *(SORT(.fini_array.*))
56   *(.fini_array)
57   _fini_array_end = .;
58
59   /* the EFI loader doesn't seem to like a .bss section, so we stick
60      it all into .data: */
61   *(.dynbss)
62   *(.bss*)
63   *(COMMON)
64  }
65  .note.gnu.build-id : { *(.note.gnu.build-id) }
66
67  . = ALIGN(4096);
68  .dynamic  : { *(.dynamic) }
69  . = ALIGN(4096);
70  .rel :
71  {
72    *(.rel.text*)
73    *(.rel.data*)
74    *(.rel.got)
75    *(.rel.dyn)
76    *(.rel.stab)
77    *(.rel.init_array*)
78    *(.rel.fini_array*)
79    *(.rel.ctors*)
80    *(.rel.dtors*)
81    *(.data.rel.ro.local)
82    *(.data.rel.local)
83    *(.data.rel.ro)
84    *(.data.rel*)
85  }
86  . = ALIGN(4096);
87  .rel.plt : { *(.rel.plt) }
88  _edata = .;
89  _data_size = . - _etext;
90  . = ALIGN(4096);
91  .reloc :		/* This is the PECOFF .reloc section! */
92  {
93    KEEP (*(.reloc))
94  }
95  . = ALIGN(4096);
96  .dynsym   : { *(.dynsym) }
97  . = ALIGN(4096);
98  .dynstr   : { *(.dynstr) }
99  . = ALIGN(4096);
100  . = DATA_SEGMENT_END (.);
101  /DISCARD/ :
102  {
103    *(.rel.reloc)
104    *(.note.GNU-stack)
105  }
106  .comment 0 : { *(.comment) }
107}
108