xref: /DragonStub/gnuefi/elf_loongarch64_efi.lds (revision 8abf159da65fe091017eaa69bc2c04a1403f342a)
1e7db4418SzhoumingtaoOUTPUT_FORMAT("elf64-loongarch", "elf64-loongarch", "elf64-loongarch")
2e7db4418SzhoumingtaoOUTPUT_ARCH(loongarch)
3e7db4418SzhoumingtaoENTRY(_start)
4e7db4418SzhoumingtaoSECTIONS
5e7db4418Szhoumingtao{
6e7db4418Szhoumingtao  .text 0x0 : {
7e7db4418Szhoumingtao    _text = .;
8e7db4418Szhoumingtao    *(.text.head)
9e7db4418Szhoumingtao    *(.text)
10e7db4418Szhoumingtao    *(.text.*)
11e7db4418Szhoumingtao    *(.gnu.linkonce.t.*)
12*8abf159dSCallum Farmer    *(.plt)
13e7db4418Szhoumingtao    . = ALIGN(16);
14e7db4418Szhoumingtao  }
15e7db4418Szhoumingtao  _etext = .;
1620110935SCallum Farmer  _text_size = _etext - _text;
17e7db4418Szhoumingtao  .dynamic  : { *(.dynamic) }
18e7db4418Szhoumingtao  .data : ALIGN(4096)
19e7db4418Szhoumingtao  {
20e7db4418Szhoumingtao   _data = .;
21e7db4418Szhoumingtao   *(.sdata)
22e7db4418Szhoumingtao   *(.data)
23e7db4418Szhoumingtao   *(.data1)
24e7db4418Szhoumingtao   *(.data.*)
25e7db4418Szhoumingtao   *(.got.plt)
26e7db4418Szhoumingtao   *(.got)
27e7db4418Szhoumingtao
28e7db4418Szhoumingtao   /* the EFI loader doesn't seem to like a .bss section, so we stick
29e7db4418Szhoumingtao      it all into .data: */
30e7db4418Szhoumingtao   . = ALIGN(16);
31e7db4418Szhoumingtao   _bss = .;
32e7db4418Szhoumingtao   *(.sbss)
33e7db4418Szhoumingtao   *(.scommon)
34e7db4418Szhoumingtao   *(.dynbss)
35e7db4418Szhoumingtao   *(.bss)
36e7db4418Szhoumingtao   *(COMMON)
37e7db4418Szhoumingtao   . = ALIGN(16);
38e7db4418Szhoumingtao   _bss_end = .;
39e7db4418Szhoumingtao  }
40e7db4418Szhoumingtao
41e7db4418Szhoumingtao  .rela.dyn : { *(.rela.dyn) }
42e7db4418Szhoumingtao  .rela.plt : { *(.rela.plt) }
43e7db4418Szhoumingtao  .rela.got : { *(.rela.got) }
44e7db4418Szhoumingtao  .rela.data : { *(.rela.data) *(.rela.data*) }
45b3e80c38SCallum Farmer  . = ALIGN(4096);
46b3e80c38SCallum Farmer  .rodata : { *(.rodata*) }
47e7db4418Szhoumingtao  . = ALIGN(512);
48e7db4418Szhoumingtao  _edata = .;
4920110935SCallum Farmer  _data_size = _edata - _data;
50e7db4418Szhoumingtao
51e7db4418Szhoumingtao  . = ALIGN(4096);
52e7db4418Szhoumingtao  .dynsym   : { *(.dynsym) }
53e7db4418Szhoumingtao  . = ALIGN(4096);
54e7db4418Szhoumingtao  .dynstr   : { *(.dynstr) }
55e7db4418Szhoumingtao  . = ALIGN(4096);
56e7db4418Szhoumingtao  .note.gnu.build-id : { *(.note.gnu.build-id) }
57e7db4418Szhoumingtao  /DISCARD/ :
58e7db4418Szhoumingtao  {
59e7db4418Szhoumingtao    *(.rel.reloc)
60e7db4418Szhoumingtao    *(.eh_frame)
61e7db4418Szhoumingtao    *(.note.GNU-stack)
62e7db4418Szhoumingtao  }
63e7db4418Szhoumingtao  .comment 0 : { *(.comment) }
64e7db4418Szhoumingtao}
65