source: mainline/kernel/arch/mips32/_link.ld.in@ 5907aa4

Last change on this file since 5907aa4 was c89ae25, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 22 months ago

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

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 * MIPS32 linker script
3 *
4 * kernel text
5 * kernel data
6 *
7 */
8
9#undef mips
10#define mips mips
11
12#if defined(MACHINE_msim)
13#define KERNEL_LOAD_ADDRESS 0x80100000
14#endif
15
16#if defined(MACHINE_lmalta) || defined(MACHINE_bmalta)
17#define KERNEL_LOAD_ADDRESS 0x80200000
18#endif
19
20OUTPUT_ARCH(mips)
21ENTRY(kernel_image_start)
22
23SECTIONS {
24 . = KERNEL_LOAD_ADDRESS;
25 kernel_load_address = .;
26 . = . + SIZEOF_HEADERS;
27
28 .text : {
29 ktext_start = .;
30 /* FIXME: for some reason, mixing .text with .text.* produces a crash on malta-be */
31 *(.text);
32 *(.text.*);
33 ktext_end = .;
34 }
35 .data : {
36 kdata_start = .;
37 *(.data .data.*); /* initialized data */
38 *(.rodata .rodata.*);
39 *(.eh_frame .eh_frame.*); /* stack unwinding data */
40 *(.eh_frame_hdr .eh_frame_hdr.*);
41 *(.sdata .sdata.*);
42 *(.reginfo);
43 *(.sbss .sbss.*);
44 *(.scommon .scommon.*);
45 *(.bss .bss.*); /* uninitialized static variables */
46 *(COMMON); /* global variables */
47 }
48 _gp = . + 0x8000;
49 .lit8 : { *(.lit8) }
50 .lit4 : { *(.lit4) }
51
52 kdata_end = .;
53
54 .comment 0 : { *(.comment); }
55 .debug_abbrev 0 : { *(.debug_abbrev); }
56 .debug_abbrev.dwo 0 : { *( .debug_abbrev.dwo); }
57 .debug_addr 0 : { *(.debug_addr); }
58 .debug_aranges 0 : { *(.debug_aranges); }
59 .debug_cu_index 0 : { *(.debug_cu_index); }
60 .debug_frame 0 : { *(.debug_frame); }
61 .debug_frame_hdr 0 : { *(.debug_frame_hdr); }
62 .debug_info 0 : { *(.debug_info); }
63 .debug_info.dwo 0 : { *(.debug_info.dwo); }
64 .debug_line 0 : { *(.debug_line); }
65 .debug_line.dwo 0 : { *(.debug_line.dwo); }
66 .debug_line_str 0 : { *(.debug_line_str); }
67 .debug_loc 0 : { *(.debug_loc); }
68 .debug_loclists 0 : { *(.debug_loclists); }
69 .debug_loclists.dwo 0 : { *(.debug_loclists.dwo); }
70 .debug_macinfo 0 : { *(.debug_macinfo); }
71 .debug_macro 0 : { *(.debug_macro); }
72 .debug_macro.dwo 0 : { *(.debug_macro.dwo); }
73 .debug_names 0 : { *(.debug_names); }
74 .debug_pubnames 0 : { *(.debug_pubnames); }
75 .debug_pubtypes 0 : { *(.debug_pubtypes); }
76 .debug_ranges 0 : { *(.debug_ranges); }
77 .debug_rnglists 0 : { *(.debug_rnglists); }
78 .debug_str 0 : { *(.debug_str); }
79 .debug_str.dwo 0 : { *(.debug_str.dwo); }
80 .debug_str_offsets 0 : { *(.debug_str_offsets); }
81 .debug_str_offsets.dwo 0 : { *(.debug_str_offsets.dwo); }
82 .debug_tu_index 0 : { *(.debug_tu_index); }
83 .debug_types 0 : { *(.debug_types); }
84
85 /DISCARD/ : {
86 *(.mdebug*);
87 *(.pdr);
88 *(.comment);
89 *(.note);
90 }
91}
Note: See TracBrowser for help on using the repository browser.