2016-01-29 16:12:31 +01:00
|
|
|
OUTPUT_ARCH(riscv)
|
|
|
|
ENTRY(_start)
|
|
|
|
|
|
|
|
SEARCH_DIR(/usr/lib);
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
/* Read-only sections, merged into text segment: */
|
2016-08-10 14:41:36 +02:00
|
|
|
. = kernbase;
|
2020-02-04 01:06:16 +01:00
|
|
|
/* The load address kernel_lma is set using --defsym= on the command line. */
|
|
|
|
.text : AT(kernel_lma)
|
2016-01-29 16:12:31 +01:00
|
|
|
{
|
|
|
|
*(.text)
|
|
|
|
*(.stub)
|
|
|
|
/* .gnu.warning sections are handled specially by elf32.em. */
|
|
|
|
*(.gnu.warning)
|
|
|
|
*(.gnu.linkonce.t*)
|
|
|
|
} =0x9090
|
|
|
|
_etext = .;
|
|
|
|
PROVIDE (etext = .);
|
|
|
|
.fini : { *(.fini) } =0x9090
|
|
|
|
.rodata : { *(.rodata) *(.gnu.linkonce.r*) }
|
|
|
|
.rodata1 : { *(.rodata1) }
|
|
|
|
.interp : { *(.interp) }
|
|
|
|
.hash : { *(.hash) }
|
|
|
|
.dynsym : { *(.dynsym) }
|
|
|
|
.dynstr : { *(.dynstr) }
|
|
|
|
.gnu.version : { *(.gnu.version) }
|
|
|
|
.gnu.version_d : { *(.gnu.version_d) }
|
|
|
|
.gnu.version_r : { *(.gnu.version_r) }
|
2019-06-04 15:07:10 +02:00
|
|
|
.note.gnu.build-id : {
|
|
|
|
PROVIDE (__build_id_start = .);
|
|
|
|
*(.note.gnu.build-id)
|
|
|
|
PROVIDE (__build_id_end = .);
|
|
|
|
}
|
2016-01-29 16:12:31 +01:00
|
|
|
.rel.text :
|
|
|
|
{ *(.rel.text) *(.rel.gnu.linkonce.t*) }
|
|
|
|
.rela.text :
|
|
|
|
{ *(.rela.text) *(.rela.gnu.linkonce.t*) }
|
|
|
|
.rel.data :
|
|
|
|
{ *(.rel.data) *(.rel.gnu.linkonce.d*) }
|
|
|
|
.rela.data :
|
|
|
|
{ *(.rela.data) *(.rela.gnu.linkonce.d*) }
|
|
|
|
.rel.rodata :
|
|
|
|
{ *(.rel.rodata) *(.rel.gnu.linkonce.r*) }
|
|
|
|
.rela.rodata :
|
|
|
|
{ *(.rela.rodata) *(.rela.gnu.linkonce.r*) }
|
|
|
|
.rel.got : { *(.rel.got) }
|
|
|
|
.rela.got : { *(.rela.got) }
|
|
|
|
.rel.ctors : { *(.rel.ctors) }
|
|
|
|
.rela.ctors : { *(.rela.ctors) }
|
|
|
|
.rel.dtors : { *(.rel.dtors) }
|
|
|
|
.rela.dtors : { *(.rela.dtors) }
|
|
|
|
.rel.init : { *(.rel.init) }
|
|
|
|
.rela.init : { *(.rela.init) }
|
|
|
|
.rel.fini : { *(.rel.fini) }
|
|
|
|
.rela.fini : { *(.rela.fini) }
|
|
|
|
.rel.bss : { *(.rel.bss) }
|
|
|
|
.rela.bss : { *(.rela.bss) }
|
|
|
|
.rel.plt : { *(.rel.plt) }
|
|
|
|
.rela.plt : { *(.rela.plt) }
|
|
|
|
.init : { *(.init) } =0x9090
|
|
|
|
.plt : { *(.plt) }
|
|
|
|
|
|
|
|
/* Adjust the address for the data segment. We want to adjust up to
|
|
|
|
the same address within the page on the next page up. */
|
|
|
|
. = ALIGN(0x1000) + (. & (0x1000 - 1)) ;
|
|
|
|
.data :
|
|
|
|
{
|
|
|
|
*(.data)
|
|
|
|
*(.gnu.linkonce.d*)
|
|
|
|
}
|
|
|
|
.data1 : { *(.data1) }
|
|
|
|
. = ALIGN(32 / 8);
|
2024-09-02 06:26:48 +02:00
|
|
|
.init_array :
|
|
|
|
{
|
|
|
|
PROVIDE_HIDDEN (__init_array_start = .);
|
|
|
|
KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))
|
|
|
|
KEEP (*(.init_array))
|
|
|
|
PROVIDE_HIDDEN (__init_array_end = .);
|
|
|
|
}
|
|
|
|
.fini_array :
|
|
|
|
{
|
|
|
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
|
|
|
KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))
|
|
|
|
KEEP (*(.fini_array))
|
|
|
|
PROVIDE_HIDDEN (__fini_array_end = .);
|
|
|
|
}
|
2016-01-29 16:12:31 +01:00
|
|
|
_start_ctors = .;
|
|
|
|
PROVIDE (start_ctors = .);
|
|
|
|
.ctors :
|
|
|
|
{
|
|
|
|
*(.ctors)
|
|
|
|
}
|
|
|
|
_stop_ctors = .;
|
|
|
|
PROVIDE (stop_ctors = .);
|
|
|
|
.dtors :
|
|
|
|
{
|
|
|
|
*(.dtors)
|
|
|
|
}
|
|
|
|
.got : { *(.got.plt) *(.got) }
|
|
|
|
.dynamic : { *(.dynamic) }
|
|
|
|
/* We want the small data sections together, so single-instruction offsets
|
|
|
|
can access them all, and initialized data all before uninitialized, so
|
|
|
|
we can shorten the on-disk segment size. */
|
|
|
|
. = ALIGN(8);
|
2019-06-09 17:43:38 +02:00
|
|
|
.sdata :
|
|
|
|
{
|
|
|
|
__global_pointer$ = . + 0x800;
|
|
|
|
*(.sdata)
|
|
|
|
}
|
2016-01-29 16:12:31 +01:00
|
|
|
_edata = .;
|
|
|
|
PROVIDE (edata = .);
|
2019-02-18 14:14:53 +01:00
|
|
|
/* Ensure __bss_start is associated with the next section in case orphan
|
|
|
|
sections are placed directly after .sdata, as has been seen to happen with
|
|
|
|
LLD. */
|
2019-09-09 17:57:24 +02:00
|
|
|
. = ALIGN(8);
|
2016-01-29 16:12:31 +01:00
|
|
|
__bss_start = .;
|
|
|
|
.sbss : { *(.sbss) *(.scommon) }
|
|
|
|
.bss :
|
|
|
|
{
|
|
|
|
*(.dynbss)
|
|
|
|
*(.bss)
|
|
|
|
*(COMMON)
|
|
|
|
}
|
|
|
|
. = ALIGN(8);
|
|
|
|
_end = . ;
|
|
|
|
PROVIDE (end = .);
|
2024-08-01 06:21:11 +02:00
|
|
|
|
|
|
|
/* Debug */
|
|
|
|
INCLUDE debuginfo.ldscript
|
2024-02-29 17:30:37 +01:00
|
|
|
|
|
|
|
.gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
|
|
|
|
/DISCARD/ : { *(.note.GNU-stack) }
|
2016-01-29 16:12:31 +01:00
|
|
|
}
|