10f9c15feSbmeng@tinylab.org/* SPDX-License-Identifier: GPL-2.0+ OR BSD-2-Clause */ 2b95f138fSHeinrich Schuchardt 3b95f138fSHeinrich SchuchardtOUTPUT_FORMAT("elf64-littleriscv", "elf64-littleriscv", "elf64-littleriscv") 4b95f138fSHeinrich SchuchardtOUTPUT_ARCH(riscv) 5b95f138fSHeinrich SchuchardtENTRY(_start) 6b95f138fSHeinrich SchuchardtSECTIONS { 7b95f138fSHeinrich Schuchardt.text 0x0 : 8b95f138fSHeinrich Schuchardt { 9b95f138fSHeinrich Schuchardt _text = .; 10b95f138fSHeinrich Schuchardt *(.text.head) 11b95f138fSHeinrich Schuchardt *(.text) 12b95f138fSHeinrich Schuchardt *(.text.*) 13b95f138fSHeinrich Schuchardt *(.gnu.linkonce.t.*) 14b95f138fSHeinrich Schuchardt *(.srodata) 15b95f138fSHeinrich Schuchardt *(.rodata*) 16b95f138fSHeinrich Schuchardt . = ALIGN(16); 17b95f138fSHeinrich Schuchardt } 18b95f138fSHeinrich Schuchardt _etext = .; 19b95f138fSHeinrich Schuchardt _text_size = . - _text; 2098f12507SLetu Ren. = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE)); 21b95f138fSHeinrich Schuchardt.dynamic : 22b95f138fSHeinrich Schuchardt { *(.dynamic) } 23b95f138fSHeinrich Schuchardt.data : 24b95f138fSHeinrich Schuchardt ALIGN(4096) 25b95f138fSHeinrich Schuchardt { 26b95f138fSHeinrich Schuchardt _data = .; 27b95f138fSHeinrich Schuchardt *(.sdata) 28b95f138fSHeinrich Schuchardt *(.data) 29b95f138fSHeinrich Schuchardt *(.data1) 30b95f138fSHeinrich Schuchardt *(.data.*) 31b95f138fSHeinrich Schuchardt *(.got.plt) 32b95f138fSHeinrich Schuchardt *(.got) 33b95f138fSHeinrich Schuchardt 34*d8e6b531SCallum Farmer /* 35*d8e6b531SCallum Farmer * Note that these aren't the using the GNU "CONSTRUCTOR" output section 36*d8e6b531SCallum Farmer * command, so they don't start with a size. Because of p2align and the 37*d8e6b531SCallum Farmer * end/END definitions, and the fact that they're mergeable, they can also 38*d8e6b531SCallum Farmer * have NULLs which aren't guaranteed to be at the end. 39*d8e6b531SCallum Farmer */ 40*d8e6b531SCallum Farmer . = ALIGN(16); 41*d8e6b531SCallum Farmer __init_array_start = .; 42*d8e6b531SCallum Farmer *(SORT(.init_array.*)) 43*d8e6b531SCallum Farmer *(.init_array) 44*d8e6b531SCallum Farmer __init_array_end = .; 45*d8e6b531SCallum Farmer . = ALIGN(16); 46*d8e6b531SCallum Farmer __CTOR_LIST__ = .; 47*d8e6b531SCallum Farmer *(SORT(.ctors.*)) 48*d8e6b531SCallum Farmer *(.ctors) 49*d8e6b531SCallum Farmer __CTOR_END__ = .; 50*d8e6b531SCallum Farmer . = ALIGN(16); 51*d8e6b531SCallum Farmer __DTOR_LIST__ = .; 52*d8e6b531SCallum Farmer *(SORT(.dtors.*)) 53*d8e6b531SCallum Farmer *(.dtors) 54*d8e6b531SCallum Farmer __DTOR_END__ = .; 55*d8e6b531SCallum Farmer . = ALIGN(16); 56*d8e6b531SCallum Farmer __fini_array_start = .; 57*d8e6b531SCallum Farmer *(SORT(.fini_array.*)) 58*d8e6b531SCallum Farmer *(.fini_array) 59*d8e6b531SCallum Farmer __fini_array_end = .; 60*d8e6b531SCallum Farmer 61*d8e6b531SCallum Farmer 62b95f138fSHeinrich Schuchardt /* the EFI loader doesn't seem to like a .bss section, so we stick 63b95f138fSHeinrich Schuchardt it all into .data: */ 64b95f138fSHeinrich Schuchardt . = ALIGN(16); 65b95f138fSHeinrich Schuchardt _bss = .; 66b95f138fSHeinrich Schuchardt *(.sbss) 67b95f138fSHeinrich Schuchardt *(.scommon) 68b95f138fSHeinrich Schuchardt *(.dynbss) 6915f10734SCallum Farmer *(.bss*) 70b95f138fSHeinrich Schuchardt *(COMMON) 71b95f138fSHeinrich Schuchardt . = ALIGN(16); 72b95f138fSHeinrich Schuchardt _bss_end = .; 73b95f138fSHeinrich Schuchardt } 74b95f138fSHeinrich Schuchardt 757ad75d91SCallum Farmer. = ALIGN(4096); 76eea6d31aSCallum Farmer.rela : 77eea6d31aSCallum Farmer { 78eea6d31aSCallum Farmer *(.rela.text*) 79eea6d31aSCallum Farmer *(.rela.data*) 80eea6d31aSCallum Farmer *(.rela.got) 8102f96e8aSCallum Farmer *(.rela.dyn) 82eea6d31aSCallum Farmer *(.rela.stab) 83*d8e6b531SCallum Farmer *(.rela.init_array*) 84*d8e6b531SCallum Farmer *(.rela.fini_array*) 85*d8e6b531SCallum Farmer *(.rela.ctors*) 86*d8e6b531SCallum Farmer *(.rela.dtors*) 87eea6d31aSCallum Farmer } 881a10c661SCallum Farmer. = ALIGN(4096); 891a10c661SCallum Farmer.rela.plt : { *(.rela.plt) } 90b95f138fSHeinrich Schuchardt . = ALIGN(512); 91b95f138fSHeinrich Schuchardt _edata = .; 92b95f138fSHeinrich Schuchardt _data_size = . - _data; 93b95f138fSHeinrich Schuchardt 94b95f138fSHeinrich Schuchardt . = ALIGN(4096); 95b95f138fSHeinrich Schuchardt.dynsym : 96b95f138fSHeinrich Schuchardt { *(.dynsym) } 97b95f138fSHeinrich Schuchardt . = ALIGN(4096); 98b95f138fSHeinrich Schuchardt.dynstr : 99b95f138fSHeinrich Schuchardt { *(.dynstr) } 100b95f138fSHeinrich Schuchardt . = ALIGN(4096); 101b95f138fSHeinrich Schuchardt.note.gnu.build-id : 102b95f138fSHeinrich Schuchardt { *(.note.gnu.build-id) } 103231c7632SCallum Farmer. = DATA_SEGMENT_END (.); 104b95f138fSHeinrich Schuchardt/DISCARD/ : 105b95f138fSHeinrich Schuchardt { 106b95f138fSHeinrich Schuchardt *(.rel.reloc) 107b95f138fSHeinrich Schuchardt *(.eh_frame) 108b95f138fSHeinrich Schuchardt *(.note.GNU-stack) 109b95f138fSHeinrich Schuchardt } 110b95f138fSHeinrich Schuchardt.comment 0 : 111b95f138fSHeinrich Schuchardt { *(.comment) } 112b95f138fSHeinrich Schuchardt} 113