2023-03-08 18:32:49 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0+ OR BSD-2-Clause */
|
2021-03-19 19:38:42 +03:00
|
|
|
|
|
|
|
OUTPUT_FORMAT("elf64-littleriscv", "elf64-littleriscv", "elf64-littleriscv")
|
|
|
|
OUTPUT_ARCH(riscv)
|
|
|
|
ENTRY(_start)
|
2023-06-16 15:49:47 +03:00
|
|
|
SECTIONS
|
|
|
|
{
|
2024-06-11 16:13:31 +03:00
|
|
|
. = 0;
|
|
|
|
ImageBase = .;
|
|
|
|
/* .hash and/or .gnu.hash MUST come first! */
|
|
|
|
.hash : { *(.hash) }
|
|
|
|
.gnu.hash : { *(.gnu.hash) }
|
|
|
|
. = ALIGN(4096);
|
|
|
|
.eh_frame : { *(.eh_frame) }
|
|
|
|
.eh_frame_hdr : { *(.eh_frame_hdr) }
|
|
|
|
.gcc_except_table : { *(.gcc_except_table*) }
|
|
|
|
. = ALIGN(4096);
|
|
|
|
.text : {
|
2023-06-16 15:49:47 +03:00
|
|
|
_text = .;
|
|
|
|
*(.text)
|
|
|
|
*(.text.*)
|
|
|
|
*(.gnu.linkonce.t.*)
|
|
|
|
*(.plt)
|
|
|
|
. = ALIGN(16);
|
2024-06-11 16:13:31 +03:00
|
|
|
}
|
|
|
|
_etext = .;
|
2023-06-16 15:49:47 +03:00
|
|
|
_text_size = _etext - _text;
|
2024-06-11 16:13:31 +03:00
|
|
|
. = ALIGN(65536);
|
|
|
|
.reloc :
|
|
|
|
{
|
|
|
|
KEEP (*(.reloc))
|
|
|
|
}
|
2023-06-16 15:49:47 +03:00
|
|
|
. = ALIGN(4096);
|
2024-07-16 12:52:21 +03:00
|
|
|
_DYNAMIC = .;
|
2023-06-16 15:49:47 +03:00
|
|
|
.dynamic : { *(.dynamic) }
|
|
|
|
. = ALIGN(4096);
|
|
|
|
.data :
|
|
|
|
{
|
2024-06-11 16:13:31 +03:00
|
|
|
_data = .;
|
2023-06-16 15:49:47 +03:00
|
|
|
*(.sdata)
|
|
|
|
*(.data)
|
|
|
|
*(.data1)
|
|
|
|
*(.data.*)
|
|
|
|
*(.got.plt)
|
|
|
|
*(.got)
|
2023-05-20 21:13:14 +03:00
|
|
|
|
2023-06-16 15:49:47 +03:00
|
|
|
/*
|
|
|
|
* Note that these aren't the using the GNU "CONSTRUCTOR" output section
|
|
|
|
* command, so they don't start with a size. Because of p2align and the
|
|
|
|
* end/END definitions, and the fact that they're mergeable, they can also
|
|
|
|
* have NULLs which aren't guaranteed to be at the end.
|
|
|
|
*/
|
|
|
|
. = ALIGN(16);
|
|
|
|
__init_array_start = .;
|
|
|
|
*(SORT(.init_array.*))
|
|
|
|
*(.init_array)
|
|
|
|
__init_array_end = .;
|
|
|
|
. = ALIGN(16);
|
|
|
|
__CTOR_LIST__ = .;
|
|
|
|
*(SORT(.ctors.*))
|
|
|
|
*(.ctors)
|
|
|
|
__CTOR_END__ = .;
|
|
|
|
. = ALIGN(16);
|
|
|
|
__DTOR_LIST__ = .;
|
|
|
|
*(SORT(.dtors.*))
|
|
|
|
*(.dtors)
|
|
|
|
__DTOR_END__ = .;
|
|
|
|
. = ALIGN(16);
|
|
|
|
__fini_array_start = .;
|
|
|
|
*(SORT(.fini_array.*))
|
|
|
|
*(.fini_array)
|
|
|
|
__fini_array_end = .;
|
2023-05-20 21:13:14 +03:00
|
|
|
|
2023-06-16 15:49:47 +03:00
|
|
|
/* the EFI loader doesn't seem to like a .bss section, so we stick
|
|
|
|
it all into .data: */
|
|
|
|
. = ALIGN(16);
|
|
|
|
_bss = .;
|
|
|
|
*(.sbss)
|
|
|
|
*(.scommon)
|
|
|
|
*(.dynbss)
|
2024-06-11 16:13:31 +03:00
|
|
|
*(.bss*)
|
2023-06-16 15:49:47 +03:00
|
|
|
*(COMMON)
|
2024-06-11 16:13:31 +03:00
|
|
|
*(.rel.local)
|
2023-06-16 15:49:47 +03:00
|
|
|
. = ALIGN(16);
|
2024-06-11 16:13:31 +03:00
|
|
|
|
2023-06-16 15:49:47 +03:00
|
|
|
_bss_end = .;
|
2024-06-11 16:13:31 +03:00
|
|
|
}
|
2021-03-19 19:38:42 +03:00
|
|
|
|
2023-06-16 15:49:47 +03:00
|
|
|
. = ALIGN(4096);
|
|
|
|
.rela :
|
2023-02-21 14:57:17 +03:00
|
|
|
{
|
|
|
|
*(.rela.text*)
|
|
|
|
*(.rela.data*)
|
|
|
|
*(.rela.got)
|
2023-03-04 20:57:39 +03:00
|
|
|
*(.rela.dyn)
|
2023-02-21 14:57:17 +03:00
|
|
|
*(.rela.stab)
|
2023-05-20 21:13:14 +03:00
|
|
|
*(.rela.init_array*)
|
|
|
|
*(.rela.fini_array*)
|
|
|
|
*(.rela.ctors*)
|
|
|
|
*(.rela.dtors*)
|
2023-06-16 15:49:47 +03:00
|
|
|
|
2023-02-21 14:57:17 +03:00
|
|
|
}
|
2023-06-16 15:49:47 +03:00
|
|
|
. = ALIGN(4096);
|
|
|
|
.rela.plt : { *(.rela.plt) }
|
|
|
|
. = ALIGN(4096);
|
2024-06-11 16:13:31 +03:00
|
|
|
.rodata : { *(.rodata*) }
|
|
|
|
. = ALIGN(512);
|
|
|
|
_edata = .;
|
|
|
|
_data_size = _edata - _data;
|
2021-03-19 19:38:42 +03:00
|
|
|
|
2023-06-16 15:49:47 +03:00
|
|
|
. = ALIGN(4096);
|
|
|
|
.dynsym : { *(.dynsym) }
|
|
|
|
. = ALIGN(4096);
|
|
|
|
.dynstr : { *(.dynstr) }
|
|
|
|
. = ALIGN(4096);
|
|
|
|
.note.gnu.build-id : { *(.note.gnu.build-id) }
|
2024-06-11 16:13:31 +03:00
|
|
|
.ignored.reloc :
|
2023-06-16 15:49:47 +03:00
|
|
|
{
|
|
|
|
*(.rela.reloc)
|
|
|
|
*(.note.GNU-stack)
|
|
|
|
}
|
|
|
|
.comment 0 : { *(.comment) }
|
2021-03-19 19:38:42 +03:00
|
|
|
}
|