| 1 | /* SPDX-License-Identifier: GPL-2.0-only */
|
| 2 | /*
|
| 3 | * Copyright (C) 2012 Regents of the University of California
|
| 4 | * Copyright (C) 2017 SiFive
|
| 5 | */
|
| 6 |
|
| 7 | |
| 8 | |
| 9 |
|
| 10 | |
| 11 | |
| 12 |
|
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 |
|
| 20 | |
| 21 | OUTPUT_ARCH(riscv)
|
| 22 | ENTRY(_start)
|
| 23 |
|
| 24 | jiffies = jiffies_64;
|
| 25 |
|
| 26 | SECTIONS
|
| 27 | {
|
| 28 | /* Beginning of code and text segment */
|
| 29 | . = LOAD_OFFSET;
|
| 30 | _start = .;
|
| 31 | HEAD_TEXT_SECTION
|
| 32 | . = ALIGN(PAGE_SIZE);
|
| 33 |
|
| 34 | .text : {
|
| 35 | _text = .;
|
| 36 | _stext = .;
|
| 37 | TEXT_TEXT
|
| 38 | SCHED_TEXT
|
| 39 | LOCK_TEXT
|
| 40 | KPROBES_TEXT
|
| 41 | ENTRY_TEXT
|
| 42 | IRQENTRY_TEXT
|
| 43 | SOFTIRQENTRY_TEXT
|
| 44 | _etext = .;
|
| 45 | }
|
| 46 |
|
| 47 | . = ALIGN(SECTION_ALIGN);
|
| 48 | __init_begin = .;
|
| 49 | __init_text_begin = .;
|
| 50 | .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) ALIGN(SECTION_ALIGN) { \
|
| 51 | _sinittext = .; \
|
| 52 | INIT_TEXT \
|
| 53 | _einittext = .; \
|
| 54 | }
|
| 55 |
|
| 56 | . = ALIGN(8);
|
| 57 | __soc_early_init_table : {
|
| 58 | __soc_early_init_table_start = .;
|
| 59 | KEEP(*(__soc_early_init_table))
|
| 60 | __soc_early_init_table_end = .;
|
| 61 | }
|
| 62 | __soc_builtin_dtb_table : {
|
| 63 | __soc_builtin_dtb_table_start = .;
|
| 64 | KEEP(*(__soc_builtin_dtb_table))
|
| 65 | __soc_builtin_dtb_table_end = .;
|
| 66 | }
|
| 67 | /* we have to discard exit text and such at runtime, not link time */
|
| 68 | __exittext_begin = .;
|
| 69 | .exit.text :
|
| 70 | {
|
| 71 | EXIT_TEXT
|
| 72 | }
|
| 73 | __exittext_end = .;
|
| 74 |
|
| 75 | __init_text_end = .;
|
| 76 | . = ALIGN(SECTION_ALIGN);
|
| 77 | |
| 78 | . = ALIGN(PECOFF_SECTION_ALIGNMENT);
|
| 79 | __pecoff_text_end = .;
|
| 80 | |
| 81 | /* Start of init data section */
|
| 82 | __init_data_begin = .;
|
| 83 | INIT_DATA_SECTION(16)
|
| 84 |
|
| 85 | .init.pi : {
|
| 86 | KEEP(*(.init.pi*))
|
| 87 | }
|
| 88 |
|
| 89 | .init.bss : {
|
| 90 | KEEP(*(.init.bss*)) /* from the EFI stub */
|
| 91 | }
|
| 92 | .exit.data :
|
| 93 | {
|
| 94 | EXIT_DATA
|
| 95 | }
|
| 96 |
|
| 97 | RUNTIME_CONST_VARIABLES
|
| 98 |
|
| 99 | PERCPU_SECTION(L1_CACHE_BYTES)
|
| 100 |
|
| 101 | .rel.dyn : {
|
| 102 | *(.rel.dyn*)
|
| 103 | }
|
| 104 |
|
| 105 | .rela.dyn : ALIGN(8) {
|
| 106 | __rela_dyn_start = .;
|
| 107 | *(.rela .rela*)
|
| 108 | __rela_dyn_end = .;
|
| 109 | }
|
| 110 |
|
| 111 | __init_data_end = .;
|
| 112 |
|
| 113 | . = ALIGN(8);
|
| 114 | .alternative : {
|
| 115 | __alt_start = .;
|
| 116 | KEEP(*(.alternative))
|
| 117 | __alt_end = .;
|
| 118 | }
|
| 119 | __init_end = .;
|
| 120 |
|
| 121 | /* Start of data section */
|
| 122 | _sdata = .;
|
| 123 | RO_DATA(SECTION_ALIGN)
|
| 124 | .srodata : {
|
| 125 | *(.srodata*)
|
| 126 | }
|
| 127 |
|
| 128 | . = ALIGN(SECTION_ALIGN);
|
| 129 | _data = .;
|
| 130 |
|
| 131 | RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN)
|
| 132 | .sdata : {
|
| 133 | __global_pointer$ = . + 0x800;
|
| 134 | *(.sdata*)
|
| 135 | }
|
| 136 |
|
| 137 | .got : { *(.got*) }
|
| 138 |
|
| 139 | |
| 140 | .data.rel : { *(.data.rel*) }
|
| 141 | .plt : { *(.plt) }
|
| 142 | .dynamic : { *(.dynamic) }
|
| 143 | .dynsym : { *(.dynsym) }
|
| 144 | .dynstr : { *(.dynstr) }
|
| 145 | .hash : { *(.hash) }
|
| 146 | .gnu.hash : { *(.gnu.hash) }
|
| 147 | |
| 148 |
|
| 149 | |
| 150 | .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); }
|
| 151 | __pecoff_data_raw_size = ABSOLUTE(. - __pecoff_text_end);
|
| 152 | __pecoff_data_raw_end = ABSOLUTE(.);
|
| 153 | |
| 154 |
|
| 155 | /* End of data section */
|
| 156 | _edata = .;
|
| 157 |
|
| 158 | BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
|
| 159 |
|
| 160 | |
| 161 | . = ALIGN(PECOFF_SECTION_ALIGNMENT);
|
| 162 | __pecoff_data_virt_size = ABSOLUTE(. - __pecoff_text_end);
|
| 163 | __pecoff_data_virt_end = ABSOLUTE(.);
|
| 164 | |
| 165 | _end = .;
|
| 166 |
|
| 167 | STABS_DEBUG
|
| 168 | DWARF_DEBUG
|
| 169 | MODINFO
|
| 170 | ELF_DETAILS
|
| 171 | .riscv.attributes 0 : { *(.riscv.attributes) }
|
| 172 |
|
| 173 | DISCARDS
|
| 174 | }
|