1/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17OUTPUT_FORMAT("elf64-littleriscv", "elf64-littleriscv", "elf64-littleriscv")
18OUTPUT_ARCH(riscv)
19SECTIONS
20{
21  .efi_header 0x0 : {
22    /* This is our PE/COFF header. Always keep it. */
23    KEEP(*(.efi_header))
24  }
25
26  .text : {
27    *(.text)
28    *(.text.*)
29    . = ALIGN(8);
30  }
31
32  .interp : { *(.interp) }
33
34  /* Dynamic sections which may involve in relocation */
35  .data.rel.ro : { *(.data.rel.ro*) }
36  .dynamic  : { *(.dynamic*) }
37  .got : { *(.got*) }
38  .dynsym  : { *(.dynsym) }
39  .dynstr  : { *(.dynstr) }
40  .gnu.hash  : { *(.gnu.hash) }
41
42  .eh_frame_hdr : { *(.eh_frame_hdr) }
43  .eh_frame : { *(.eh_frame) }
44
45  . = ALIGN(4096);
46  .data : {
47    *(.rodata*)
48    *(.data*)
49    *(.sdata)
50
51    /*
52    Tranditionally bss section are stuffed into .data section becase
53    some PE32+ loader doesn't support a separate bss section.
54    */
55    . = ALIGN(16);
56    *(.sbss)
57    *(.scommon)
58    *(.dynbss)
59    *(.bss)
60    *(.bss.*)
61    *(COMMON)
62  }
63
64  . = ALIGN(4096);
65  .note.gnu.build-id : { *(.note.gnu.build-id) }
66
67  /DISCARD/ : {
68    *(.debug*)
69    *(.comment)
70  }
71
72  _end = .;
73}
74