xref: /haiku/src/system/ldscripts/x86/boot_loader_efi.ld (revision 9e25244c5e9051f6cd333820d6332397361abd6c)
1/*
2   Copyright (c) 1998-2000 Intel Corporation
3
4   Redistribution and use in source and binary forms, with or without modification, are permitted
5   provided that the following conditions are met:
6
7   Redistributions of source code must retain the above copyright notice, this list of conditions and
8   the following disclaimer.
9
10   Redistributions in binary form must reproduce the above copyright notice, this list of conditions
11   and the following disclaimer in the documentation and/or other materials provided with the
12   distribution.
13
14   THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
15   INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16   FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INTEL BE
17   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
23   POSSIBILITY OF SUCH DAMAGE. THE EFI SPECIFICATION AND ALL OTHER INFORMATION
24   ON THIS WEB SITE ARE PROVIDED "AS IS" WITH NO WARRANTIES, AND ARE SUBJECT
25   TO CHANGE WITHOUT NOTICE.
26*/
27
28/* Same as elf_ia32_efi.lds, except for ctor support */
29OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
30OUTPUT_ARCH(i386)
31ENTRY(_start)
32SECTIONS
33{
34  . = 0;
35  ImageBase = .;
36  /* .hash and/or .gnu.hash MUST come first! */
37  .hash : { *(.hash) }
38  .gnu.hash : { *(.gnu.hash) }
39  . = ALIGN(4096);
40  .text :
41  {
42   _text = .;
43   *(.text)
44   *(.text.*)
45   *(.gnu.linkonce.t.*)
46   . = ALIGN(16);
47  }
48  _etext = .;
49  _text_size = . - _text;
50  . = ALIGN(4096);
51  .sdata :
52  {
53   __ctor_list = .;
54   *(.ctors)
55   __ctor_end = .;
56   _data = .;
57   *(.got.plt)
58   *(.got)
59   *(.srodata)
60   *(.sdata)
61   *(.sbss)
62   *(.scommon)
63  }
64  . = ALIGN(4096);
65  .data :
66  {
67   *(.rodata*)
68   *(.data)
69   *(.data1)
70   *(.data.*)
71   *(.sdata)
72   *(.got.plt)
73   *(.got)
74   /* the EFI loader doesn't seem to like a .bss section, so we stick
75      it all into .data: */
76   *(.sbss)
77   *(.scommon)
78   *(.dynbss)
79   *(.bss)
80   *(COMMON)
81  }
82  .note.gnu.build-id : { *(.note.gnu.build-id) }
83
84  . = ALIGN(4096);
85  .dynamic  : { *(.dynamic) }
86  . = ALIGN(4096);
87  .rel :
88  {
89    *(.rel.data)
90    *(.rel.data.*)
91    *(.rel.ctors)
92    *(.rel.got)
93    *(.rel.stab)
94    *(.data.rel.ro.local)
95    *(.data.rel.local)
96    *(.data.rel.ro)
97    *(.data.rel*)
98  }
99  _edata = .;
100  _data_size = . - _etext;
101  . = ALIGN(4096);
102  .reloc :		/* This is the PECOFF .reloc section! */
103  {
104    *(.reloc)
105  }
106  . = ALIGN(4096);
107  .dynsym   : { *(.dynsym) }
108  . = ALIGN(4096);
109  .dynstr   : { *(.dynstr) }
110  . = ALIGN(4096);
111  /DISCARD/ :
112  {
113    *(.rel.reloc)
114    *(.eh_frame)
115    *(.note.GNU-stack)
116  }
117  .comment 0 : { *(.comment) }
118}
119