source: mainline/kernel/arch/mips32/_link.ld.in

Last change on this file was 6677acb, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 19 months ago

Emit .text/.data/.eh_frame sections in kernel ELF files

Gives tools like objdump an easier time interpreting contents of
the file, and allows kernel to find .eh_frame_hdr since the linker
emits a program header for it when it's present under the standard
name.

  • Property mode set to 100644
File size: 2.6 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
36 /* stack unwinding data */
37 .eh_frame_hdr : {
38 eh_frame_hdr_start = .;
39 *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*);
40 eh_frame_hdr_end = .;
41 }
42
43 .eh_frame : {
44 eh_frame_start = .;
45 KEEP(*(.eh_frame .eh_frame.*));
46 eh_frame_end = .;
47 }
48
49 .data : {
50 kdata_start = .;
51 *(.data .data.*); /* initialized data */
52 *(.rodata .rodata.*);
53 *(.sdata .sdata.*);
54 *(.reginfo);
55 *(.sbss .sbss.*);
56 *(.scommon .scommon.*);
57 *(.bss .bss.*); /* uninitialized static variables */
58 *(COMMON); /* global variables */
59 }
60
61 _gp = . + 0x8000;
62 .lit8 : { *(.lit8) }
63 .lit4 : { *(.lit4) }
64
65 kdata_end = .;
66
67 .comment 0 : { *(.comment); }
68 .debug_abbrev 0 : { *(.debug_abbrev); }
69 .debug_abbrev.dwo 0 : { *( .debug_abbrev.dwo); }
70 .debug_addr 0 : { *(.debug_addr); }
71 .debug_aranges 0 : { *(.debug_aranges); }
72 .debug_cu_index 0 : { *(.debug_cu_index); }
73 .debug_frame 0 : { *(.debug_frame); }
74 .debug_frame_hdr 0 : { *(.debug_frame_hdr); }
75 .debug_info 0 : { *(.debug_info); }
76 .debug_info.dwo 0 : { *(.debug_info.dwo); }
77 .debug_line 0 : { *(.debug_line); }
78 .debug_line.dwo 0 : { *(.debug_line.dwo); }
79 .debug_line_str 0 : { *(.debug_line_str); }
80 .debug_loc 0 : { *(.debug_loc); }
81 .debug_loclists 0 : { *(.debug_loclists); }
82 .debug_loclists.dwo 0 : { *(.debug_loclists.dwo); }
83 .debug_macinfo 0 : { *(.debug_macinfo); }
84 .debug_macro 0 : { *(.debug_macro); }
85 .debug_macro.dwo 0 : { *(.debug_macro.dwo); }
86 .debug_names 0 : { *(.debug_names); }
87 .debug_pubnames 0 : { *(.debug_pubnames); }
88 .debug_pubtypes 0 : { *(.debug_pubtypes); }
89 .debug_ranges 0 : { *(.debug_ranges); }
90 .debug_rnglists 0 : { *(.debug_rnglists); }
91 .debug_str 0 : { *(.debug_str); }
92 .debug_str.dwo 0 : { *(.debug_str.dwo); }
93 .debug_str_offsets 0 : { *(.debug_str_offsets); }
94 .debug_str_offsets.dwo 0 : { *(.debug_str_offsets.dwo); }
95 .debug_tu_index 0 : { *(.debug_tu_index); }
96 .debug_types 0 : { *(.debug_types); }
97
98 /DISCARD/ : {
99 *(.mdebug*);
100 *(.pdr);
101 *(.comment);
102 *(.note);
103 }
104}
Note: See TracBrowser for help on using the repository browser.