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 = .;
87 *(.init.bss) /* from the EFI stub */
93 PERCPU_SECTION(L1_CACHE_BYTES)
113 /* Start of data section */
115 RO_DATA(SECTION_ALIGN)
120 . = ALIGN(SECTION_ALIGN);
123 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN)
125 __global_pointer$ = . + 0x800;
130 .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); }
131 __pecoff_data_raw_size = ABSOLUTE(. - __pecoff_text_end);
132 __pecoff_data_raw_end = ABSOLUTE(.);
135 /* End of data section */
138 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
141 . = ALIGN(PECOFF_SECTION_ALIGNMENT);
142 __pecoff_data_virt_size = ABSOLUTE(. - __pecoff_text_end);
143 __pecoff_data_virt_end = ABSOLUTE(.);
150 .riscv.attributes 0 : { *(.riscv.attributes) }
154 #endif /* CONFIG_XIP_KERNEL */