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