source: mainline/kernel/arch/arm64/_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.3 KB
Line 
1/*
2 * ARM64 linker script
3 *
4 * kernel text
5 * kernel data
6 *
7 */
8
9#include <arch/boot/boot.h>
10#include <arch/mm/km.h>
11
12#define LOAD_ADDRESS_V (KM_ARM64_IDENTITY_START + BOOT_OFFSET)
13#define LOAD_ADDRESS_P BOOT_OFFSET
14
15OUTPUT_ARCH(aarch64)
16ENTRY(kernel_image_start)
17
18SECTIONS {
19 kernel_load_address = LOAD_ADDRESS_V;
20
21 .text (LOAD_ADDRESS_V + SIZEOF_HEADERS) : AT (LOAD_ADDRESS_P + SIZEOF_HEADERS) {
22 . = ALIGN(16);
23 ktext_start = .;
24 KEEP(*(K_TEXT_START))
25 *(.text .text.*);
26 ktext_end = .;
27 }
28
29 /* stack unwinding data */
30 .eh_frame_hdr : {
31 eh_frame_hdr_start = .;
32 *(.eh_frame_hdr) *(.eh_frame_entry .eh_frame_entry.*);
33 eh_frame_hdr_end = .;
34 }
35
36 .eh_frame : {
37 eh_frame_start = .;
38 KEEP(*(.eh_frame .eh_frame.*));
39 eh_frame_end = .;
40 }
41
42 .data : {
43 kdata_start = .;
44 KEEP(*(K_DATA_START))
45 *(.rodata .rodata.*);
46 *(.data .data.*); /* initialized data */
47 *(.bss .bss.*); /* uninitialized static variables */
48 *(COMMON); /* global variables */
49 kdata_end = .;
50 }
51
52 .comment 0 : { *(.comment); }
53 .debug_abbrev 0 : { *(.debug_abbrev); }
54 .debug_abbrev.dwo 0 : { *( .debug_abbrev.dwo); }
55 .debug_addr 0 : { *(.debug_addr); }
56 .debug_aranges 0 : { *(.debug_aranges); }
57 .debug_cu_index 0 : { *(.debug_cu_index); }
58 .debug_frame 0 : { *(.debug_frame); }
59 .debug_frame_hdr 0 : { *(.debug_frame_hdr); }
60 .debug_info 0 : { *(.debug_info); }
61 .debug_info.dwo 0 : { *(.debug_info.dwo); }
62 .debug_line 0 : { *(.debug_line); }
63 .debug_line.dwo 0 : { *(.debug_line.dwo); }
64 .debug_line_str 0 : { *(.debug_line_str); }
65 .debug_loc 0 : { *(.debug_loc); }
66 .debug_loclists 0 : { *(.debug_loclists); }
67 .debug_loclists.dwo 0 : { *(.debug_loclists.dwo); }
68 .debug_macinfo 0 : { *(.debug_macinfo); }
69 .debug_macro 0 : { *(.debug_macro); }
70 .debug_macro.dwo 0 : { *(.debug_macro.dwo); }
71 .debug_names 0 : { *(.debug_names); }
72 .debug_pubnames 0 : { *(.debug_pubnames); }
73 .debug_pubtypes 0 : { *(.debug_pubtypes); }
74 .debug_ranges 0 : { *(.debug_ranges); }
75 .debug_rnglists 0 : { *(.debug_rnglists); }
76 .debug_str 0 : { *(.debug_str); }
77 .debug_str.dwo 0 : { *(.debug_str.dwo); }
78 .debug_str_offsets 0 : { *(.debug_str_offsets); }
79 .debug_str_offsets.dwo 0 : { *(.debug_str_offsets.dwo); }
80 .debug_tu_index 0 : { *(.debug_tu_index); }
81 .debug_types 0 : { *(.debug_types); }
82
83 /DISCARD/ : {
84 *(*);
85 }
86}
Note: See TracBrowser for help on using the repository browser.