1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2012 Regents of the University of California
4 * Copyright (C) 2017 SiFive
7 #define RO_EXCEPTION_TABLE_ALIGN 4
8 #define RUNTIME_DISCARD_EXIT
10 #ifdef CONFIG_XIP_KERNEL
11 #include "vmlinux-xip.lds.S"
14 #include <asm/pgtable.h>
15 #define LOAD_OFFSET KERNEL_LINK_ADDR
17 #include <asm/vmlinux.lds.h>
19 #include <asm/cache.h>
20 #include <asm/thread_info.h>
21 #include <asm/set_memory.h>
22 #include "image-vars.h"
24 #include <linux/sizes.h>
32 /* Beginning of code and text segment */
51 . = ALIGN(SECTION_ALIGN);
53 __init_text_begin = .;
54 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) ALIGN(SECTION_ALIGN) { \
61 __soc_early_init_table : {
62 __soc_early_init_table_start = .;
63 KEEP(*(__soc_early_init_table))
64 __soc_early_init_table_end = .;
66 __soc_builtin_dtb_table : {
67 __soc_builtin_dtb_table_start = .;
68 KEEP(*(__soc_builtin_dtb_table))
69 __soc_builtin_dtb_table_end = .;
71 /* we have to discard exit text and such at runtime, not link time */
78 . = ALIGN(SECTION_ALIGN);
80 . = ALIGN(PECOFF_SECTION_ALIGNMENT);
81 __pecoff_text_end = .;
83 /* Start of init data section */
84 __init_data_begin = .;
92 *(.init.bss) /* from the EFI stub */
98 PERCPU_SECTION(L1_CACHE_BYTES)
104 .rela.dyn : ALIGN(8) {
105 __rela_dyn_start = .;
120 /* Start of data section */
122 RO_DATA(SECTION_ALIGN)
127 . = ALIGN(SECTION_ALIGN);
130 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN)
132 __global_pointer$ = . + 0x800;
138 #ifdef CONFIG_RELOCATABLE
139 .data.rel : { *(.data.rel*) }
141 .dynamic : { *(.dynamic) }
142 .dynsym : { *(.dynsym) }
143 .dynstr : { *(.dynstr) }
145 .gnu.hash : { *(.gnu.hash) }
149 .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); }
150 __pecoff_data_raw_size = ABSOLUTE(. - __pecoff_text_end);
151 __pecoff_data_raw_end = ABSOLUTE(.);
154 /* End of data section */
157 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
160 . = ALIGN(PECOFF_SECTION_ALIGNMENT);
161 __pecoff_data_virt_size = ABSOLUTE(. - __pecoff_text_end);
162 __pecoff_data_virt_end = ABSOLUTE(.);
169 .riscv.attributes 0 : { *(.riscv.attributes) }
173 #endif /* CONFIG_XIP_KERNEL */