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 */
80 . = ALIGN(SECTION_ALIGN);
82 . = ALIGN(PECOFF_SECTION_ALIGNMENT);
83 __pecoff_text_end = .;
85 /* Start of init data section */
86 __init_data_begin = .;
94 KEEP(*(.init.bss*)) /* from the EFI stub */
100 PERCPU_SECTION(L1_CACHE_BYTES)
106 .rela.dyn : ALIGN(8) {
107 __rela_dyn_start = .;
117 KEEP(*(.alternative))
122 /* Start of data section */
124 RO_DATA(SECTION_ALIGN)
129 . = ALIGN(SECTION_ALIGN);
132 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN)
134 __global_pointer$ = . + 0x800;
140 #ifdef CONFIG_RELOCATABLE
141 .data.rel : { *(.data.rel*) }
143 .dynamic : { *(.dynamic) }
144 .dynsym : { *(.dynsym) }
145 .dynstr : { *(.dynstr) }
147 .gnu.hash : { *(.gnu.hash) }
151 .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); }
152 __pecoff_data_raw_size = ABSOLUTE(. - __pecoff_text_end);
153 __pecoff_data_raw_end = ABSOLUTE(.);
156 /* End of data section */
159 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
162 . = ALIGN(PECOFF_SECTION_ALIGNMENT);
163 __pecoff_data_virt_size = ABSOLUTE(. - __pecoff_text_end);
164 __pecoff_data_virt_end = ABSOLUTE(.);
171 .riscv.attributes 0 : { *(.riscv.attributes) }
175 #endif /* CONFIG_XIP_KERNEL */