xref: /netbsd-src/sys/arch/i386/stand/efiboot/bootia32/ldscript (revision d72c9455a0f0b53c27de8707ee21f1fe4126cd26)
1/*	$NetBSD: ldscript,v 1.2 2018/12/24 18:21:50 christos Exp $	*/
2OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
3OUTPUT_ARCH(i386)
4ENTRY(_start)
5
6PHDRS
7{
8  text PT_LOAD;
9  headers PT_PHDR FILEHDR PHDRS;
10}
11
12SECTIONS
13{
14  . = 0;
15  ImageBase = .;
16  .hash : { *(.hash) }	/* this MUST come first! */
17  . = ALIGN(4096);
18  .text :
19  {
20   *(.text)
21   *(.text.*)
22   *(.gnu.linkonce.t.*)
23  } :text
24  . = ALIGN(4096);
25  .sdata :
26  {
27   *(.got.plt)
28   *(.got)
29   *(.srodata)
30   *(.sdata)
31   *(.sbss)
32   *(.scommon)
33  }
34  . = ALIGN(4096);
35  .data :
36  {
37   *(.rodata*)
38   *(.data)
39   *(.data1)
40   *(.data.*)
41   *(.sdata)
42   *(.got.plt)
43   *(.got)
44   /* the EFI loader doesn't seem to like a .bss section, so we stick
45      it all into .data: */
46   *(.sbss)
47   *(.scommon)
48   *(.dynbss)
49   *(.bss)
50   *(COMMON)
51  }
52  . = ALIGN(4096);
53  .dynamic  : { *(.dynamic) }
54  . = ALIGN(4096);
55  .rel :
56  {
57    *(.rel.data)
58    *(.rel.data.*)
59    *(.rel.got)
60    *(.rel.stab)
61    *(.data.rel.ro.local)
62    *(.data.rel.local)
63    *(.data.rel.ro)
64    *(.data.rel*)
65  }
66  . = ALIGN(4096);
67  .reloc :		/* This is the PECOFF .reloc section! */
68  {
69    *(.reloc)
70  }
71  . = ALIGN(4096);
72  .dynsym   : { *(.dynsym) }
73  . = ALIGN(4096);
74  .dynstr   : { *(.dynstr) }
75  . = ALIGN(4096);
76  /DISCARD/ :
77  {
78    *(.rel.reloc)
79    *(.eh_frame)
80    *(.note.GNU-stack)
81  }
82  .comment 0 : { *(.comment) }
83}
84