[84176f3] | 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 |
|
---|
| 15 | OUTPUT_ARCH(aarch64)
|
---|
| 16 | ENTRY(kernel_image_start)
|
---|
| 17 |
|
---|
| 18 | SECTIONS {
|
---|
| 19 | kernel_load_address = LOAD_ADDRESS_V;
|
---|
| 20 |
|
---|
[6677acb] | 21 | .text (LOAD_ADDRESS_V + SIZEOF_HEADERS) : AT (LOAD_ADDRESS_P + SIZEOF_HEADERS) {
|
---|
[84176f3] | 22 | . = ALIGN(16);
|
---|
| 23 | ktext_start = .;
|
---|
[c89ae25] | 24 | KEEP(*(K_TEXT_START))
|
---|
[84176f3] | 25 | *(.text .text.*);
|
---|
| 26 | ktext_end = .;
|
---|
[6677acb] | 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 | }
|
---|
[84176f3] | 41 |
|
---|
[6677acb] | 42 | .data : {
|
---|
[84176f3] | 43 | kdata_start = .;
|
---|
[c89ae25] | 44 | KEEP(*(K_DATA_START))
|
---|
[6677acb] | 45 | *(.rodata .rodata.*);
|
---|
[c89ae25] | 46 | *(.data .data.*); /* initialized data */
|
---|
| 47 | *(.bss .bss.*); /* uninitialized static variables */
|
---|
[84176f3] | 48 | *(COMMON); /* global variables */
|
---|
| 49 | kdata_end = .;
|
---|
| 50 | }
|
---|
| 51 |
|
---|
| 52 | .comment 0 : { *(.comment); }
|
---|
| 53 | .debug_abbrev 0 : { *(.debug_abbrev); }
|
---|
[da13982] | 54 | .debug_abbrev.dwo 0 : { *( .debug_abbrev.dwo); }
|
---|
| 55 | .debug_addr 0 : { *(.debug_addr); }
|
---|
[84176f3] | 56 | .debug_aranges 0 : { *(.debug_aranges); }
|
---|
[da13982] | 57 | .debug_cu_index 0 : { *(.debug_cu_index); }
|
---|
[84176f3] | 58 | .debug_frame 0 : { *(.debug_frame); }
|
---|
[da13982] | 59 | .debug_frame_hdr 0 : { *(.debug_frame_hdr); }
|
---|
[84176f3] | 60 | .debug_info 0 : { *(.debug_info); }
|
---|
[da13982] | 61 | .debug_info.dwo 0 : { *(.debug_info.dwo); }
|
---|
[84176f3] | 62 | .debug_line 0 : { *(.debug_line); }
|
---|
[da13982] | 63 | .debug_line.dwo 0 : { *(.debug_line.dwo); }
|
---|
| 64 | .debug_line_str 0 : { *(.debug_line_str); }
|
---|
[84176f3] | 65 | .debug_loc 0 : { *(.debug_loc); }
|
---|
[da13982] | 66 | .debug_loclists 0 : { *(.debug_loclists); }
|
---|
| 67 | .debug_loclists.dwo 0 : { *(.debug_loclists.dwo); }
|
---|
[84176f3] | 68 | .debug_macinfo 0 : { *(.debug_macinfo); }
|
---|
[da13982] | 69 | .debug_macro 0 : { *(.debug_macro); }
|
---|
| 70 | .debug_macro.dwo 0 : { *(.debug_macro.dwo); }
|
---|
| 71 | .debug_names 0 : { *(.debug_names); }
|
---|
[84176f3] | 72 | .debug_pubnames 0 : { *(.debug_pubnames); }
|
---|
| 73 | .debug_pubtypes 0 : { *(.debug_pubtypes); }
|
---|
| 74 | .debug_ranges 0 : { *(.debug_ranges); }
|
---|
[da13982] | 75 | .debug_rnglists 0 : { *(.debug_rnglists); }
|
---|
[84176f3] | 76 | .debug_str 0 : { *(.debug_str); }
|
---|
[da13982] | 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); }
|
---|
[84176f3] | 82 |
|
---|
| 83 | /DISCARD/ : {
|
---|
| 84 | *(*);
|
---|
| 85 | }
|
---|
| 86 | }
|
---|