source: mainline/kernel/arch/riscv64/_link.ld.in@ dcd8214

topic/msim-upgrade topic/simplify-dev-export
Last change on this file since dcd8214 was c89ae25, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 2 years ago

Fix and enable —gc-sections in /kernel and /boot

  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*
2 * RISC-V 64 linker script
3 *
4 * kernel text
5 * kernel data
6 *
7 */
8
9OUTPUT_ARCH(riscv)
10ENTRY(kernel_image_start)
11
12#include <arch/boot/boot.h>
13#include <arch/mm/page.h>
14
15SECTIONS {
16 kernel_load_address = PA2KA(BOOT_OFFSET);
17
18 .image (PA2KA(BOOT_OFFSET) + SIZEOF_HEADERS) : AT (BOOT_OFFSET + SIZEOF_HEADERS) {
19 ktext_start = .;
20 KEEP(*(K_TEXT_START));
21 *(.text .text.*);
22 ktext_end = .;
23
24 kdata_start = .;
25 *(.data .data.*); /* initialized data */
26 *(.rodata .rodata.*);
27 *(.eh_frame .eh_frame.*); /* stack unwinding data */
28 *(.eh_frame_hdr .eh_frame_hdr.*);
29 *(.sdata .sdata.*);
30 *(.sbss .sbss.*);
31 *(.scommon .scommon.*);
32 *(.bss .bss.*); /* uninitialized static variables */
33 *(COMMON); /* global variables */
34 kdata_end = .;
35 }
36
37 .comment 0 : { *(.comment); }
38 .debug_abbrev 0 : { *(.debug_abbrev); }
39 .debug_abbrev.dwo 0 : { *( .debug_abbrev.dwo); }
40 .debug_addr 0 : { *(.debug_addr); }
41 .debug_aranges 0 : { *(.debug_aranges); }
42 .debug_cu_index 0 : { *(.debug_cu_index); }
43 .debug_frame 0 : { *(.debug_frame); }
44 .debug_frame_hdr 0 : { *(.debug_frame_hdr); }
45 .debug_info 0 : { *(.debug_info); }
46 .debug_info.dwo 0 : { *(.debug_info.dwo); }
47 .debug_line 0 : { *(.debug_line); }
48 .debug_line.dwo 0 : { *(.debug_line.dwo); }
49 .debug_line_str 0 : { *(.debug_line_str); }
50 .debug_loc 0 : { *(.debug_loc); }
51 .debug_loclists 0 : { *(.debug_loclists); }
52 .debug_loclists.dwo 0 : { *(.debug_loclists.dwo); }
53 .debug_macinfo 0 : { *(.debug_macinfo); }
54 .debug_macro 0 : { *(.debug_macro); }
55 .debug_macro.dwo 0 : { *(.debug_macro.dwo); }
56 .debug_names 0 : { *(.debug_names); }
57 .debug_pubnames 0 : { *(.debug_pubnames); }
58 .debug_pubtypes 0 : { *(.debug_pubtypes); }
59 .debug_ranges 0 : { *(.debug_ranges); }
60 .debug_rnglists 0 : { *(.debug_rnglists); }
61 .debug_str 0 : { *(.debug_str); }
62 .debug_str.dwo 0 : { *(.debug_str.dwo); }
63 .debug_str_offsets 0 : { *(.debug_str_offsets); }
64 .debug_str_offsets.dwo 0 : { *(.debug_str_offsets.dwo); }
65 .debug_tu_index 0 : { *(.debug_tu_index); }
66 .debug_types 0 : { *(.debug_types); }
67
68 /DISCARD/ : {
69 *(.mdebug*);
70 *(.pdr);
71 *(.comment);
72 *(.note);
73 }
74}
Note: See TracBrowser for help on using the repository browser.