xref: /kvm-unit-tests/x86/efi/elf_x86_64_efi.lds (revision 92a6c9b95ab10eba66bff3ff44476ab0c015b276)
1/* Developed based on GNU-EFI/gnuefi/elf_x86_64_efi.lds, licensed under GNU GPL */
2/* Same as elf_x86_64_fbsd_efi.lds, except for OUTPUT_FORMAT below - KEEP IN SYNC */
3OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
4OUTPUT_ARCH(i386:x86-64)
5ENTRY(_start)
6SECTIONS
7{
8  . = 0;
9  ImageBase = .;
10  /* .hash and/or .gnu.hash MUST come first! */
11  .hash : { *(.hash) }
12  .gnu.hash : { *(.gnu.hash) }
13  . = ALIGN(4096);
14  .eh_frame :
15  {
16    *(.eh_frame)
17  }
18  . = ALIGN(4096);
19  .text :
20  {
21   _text = .;
22   *(.text)
23   *(.text.*)
24   *(.gnu.linkonce.t.*)
25   . = ALIGN(16);
26  }
27  _etext = .;
28  _text_size = . - _text;
29  . = ALIGN(4096);
30  .reloc :
31  {
32   *(.reloc)
33  }
34  . = ALIGN(4096);
35  .data :
36  {
37   _data = .;
38   *(.rodata*)
39   *(.got.plt)
40   *(.got)
41   /* Expected by lib/x86/desc.c to store exception_table */
42   exception_table_start = .;
43   *(.data.ex)
44   exception_table_end = .;
45   *(.data*)
46   *(.sdata)
47   /* the EFI loader doesn't seem to like a .bss section, so we stick
48      it all into .data: */
49   *(.sbss)
50   *(.scommon)
51   *(.dynbss)
52   *(.bss)
53   *(COMMON)
54   *(.rel.local)
55  }
56  .note.gnu.build-id : { *(.note.gnu.build-id) }
57
58  _edata = .;
59  _data_size = . - _etext;
60  . = ALIGN(4096);
61  .dynamic  : { *(.dynamic) }
62  . = ALIGN(4096);
63  .rela :
64  {
65    *(.rela.data*)
66    *(.rela.got)
67    *(.rela.stab)
68  }
69  . = ALIGN(4096);
70  .dynsym   : { *(.dynsym) }
71  . = ALIGN(4096);
72  .dynstr   : { *(.dynstr) }
73  . = ALIGN(4096);
74  .ignored.reloc :
75  {
76    *(.rela.reloc)
77    *(.eh_frame)
78    *(.note.GNU-stack)
79  }
80  .comment 0 : { *(.comment) }
81}
82