1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Copyright (C) 2012 Regents of the Universit 4 * Copyright (C) 2017 SiFive 5 * Copyright (C) 2020 Vitaly Wool, Konsulko AB 6 */ 7 8 #include <asm/pgtable.h> 9 #define LOAD_OFFSET KERNEL_LINK_ADDR 10 /* No __ro_after_init data in the .rodata sect 11 #define RO_AFTER_INIT_DATA 12 13 #include <asm/vmlinux.lds.h> 14 #include <asm/page.h> 15 #include <asm/cache.h> 16 #include <asm/thread_info.h> 17 #include <asm/set_memory.h> 18 19 OUTPUT_ARCH(riscv) 20 ENTRY(_start) 21 22 jiffies = jiffies_64; 23 24 SECTIONS 25 { 26 /* Beginning of code and text segment 27 . = LOAD_OFFSET; 28 _xiprom = .; 29 _start = .; 30 HEAD_TEXT_SECTION 31 INIT_TEXT_SECTION(PAGE_SIZE) 32 /* we have to discard exit text and su 33 __exittext_begin = .; 34 .exit.text : 35 { 36 EXIT_TEXT 37 } 38 __exittext_end = .; 39 40 .text : { 41 _text = .; 42 _stext = .; 43 TEXT_TEXT 44 SCHED_TEXT 45 LOCK_TEXT 46 KPROBES_TEXT 47 ENTRY_TEXT 48 IRQENTRY_TEXT 49 SOFTIRQENTRY_TEXT 50 _etext = .; 51 } 52 RO_DATA(L1_CACHE_BYTES) 53 .srodata : { 54 *(.srodata*) 55 } 56 .init.rodata : { 57 INIT_SETUP(16) 58 INIT_CALLS 59 CON_INITCALL 60 INIT_RAM_FS 61 } 62 _exiprom = .; /* End 63 64 65 /* 66 * From this point, stuff is considered writab 67 */ 68 __data_loc = ALIGN(PAGE_SIZE); 69 . = ALIGN(SECTION_ALIGN); 70 71 #undef LOAD_OFFSET 72 #define LOAD_OFFSET (KERNEL_LINK_ADDR + _sdata 73 74 _sdata = .; /* Sta 75 _data = .; 76 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THR 77 _edata = .; 78 __start_ro_after_init = .; 79 .data.ro_after_init : AT(ADDR(.data.ro 80 *(.data..ro_after_init) 81 } 82 __end_ro_after_init = .; 83 84 . = ALIGN(PAGE_SIZE); 85 __init_begin = .; 86 .init.data : { 87 INIT_DATA 88 } 89 .exit.data : { 90 EXIT_DATA 91 } 92 . = ALIGN(8); 93 __soc_early_init_table : { 94 __soc_early_init_table_start = 95 KEEP(*(__soc_early_init_table) 96 __soc_early_init_table_end = . 97 } 98 __soc_builtin_dtb_table : { 99 __soc_builtin_dtb_table_start 100 KEEP(*(__soc_builtin_dtb_table 101 __soc_builtin_dtb_table_end = 102 } 103 104 __init_end = .; 105 106 . = ALIGN(16); 107 .xip.traps : { 108 __xip_traps_start = .; 109 *(.xip.traps) 110 __xip_traps_end = .; 111 } 112 113 . = ALIGN(PAGE_SIZE); 114 .sdata : { 115 __global_pointer$ = . + 0x800; 116 *(.sdata*) 117 *(.sbss*) 118 } 119 120 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0) 121 122 PERCPU_SECTION(L1_CACHE_BYTES) 123 124 .rel.dyn : AT(ADDR(.rel.dyn) - LOAD_OF 125 *(.rel.dyn*) 126 } 127 128 /* 129 * End of copied data. We need a dummy 130 * Also located before final ALIGN() a 131 * in the resulting binary file and us 132 */ 133 .data.endmark : AT(ADDR(.data.endmark) 134 _edata_loc = LOADADDR(.data.endmark); 135 136 . = ALIGN(PAGE_SIZE); 137 _end = .; 138 139 STABS_DEBUG 140 DWARF_DEBUG 141 142 DISCARDS 143 }
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.