xref: /haiku/src/system/ldscripts/riscv64/boot_loader_riscv.ld (revision 4365774b6889e9467e4fd8719c5c89ca56240d28)
1OUTPUT_FORMAT("elf64-littleriscv", "elf64-littleriscv", "elf64-littleriscv")
2OUTPUT_ARCH(riscv)
3
4ENTRY(_start)
5SECTIONS
6{
7	. = 0x80000000;
8
9	/* text/read-only data */
10  .text : {
11    *(.text.head)
12    *(.text)
13    *(.text.*)
14    *(.gnu.linkonce.t.*)
15  }
16
17	. = ALIGN(0x8);
18	__ctor_list = .;
19	.ctors : { *(.ctors) }
20	__ctor_end = .;
21
22	.rodata : { *(.rodata .rodata.*) }
23
24	/* writable data  */
25	. = ALIGN(0x1000);
26	__data_start = .;
27	.data : {
28		*(.data)
29		*(.data.*)
30		*(.gnu.linkonce.d.*)
31	}
32	.got : { *(.got.plt) *(.got) }
33	.dynamic : { gDynamic = .; *(.dynamic) }
34
35	/* uninitialized data (in same segment as writable data) */
36	__bss_start = .;
37	.bss : { *(.bss) }
38
39	. = ALIGN(0x1000);
40	_end = . ;
41
42	.bss.stack : { *(.bss.stack) }
43
44	/* Strip unnecessary stuff */
45	/DISCARD/ : { *(.comment .note .eh_frame .dtors .stab .stabstr .debug*) }
46}
47