1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2012 Regents of the University of California
4 * Copyright (C) 2017 SiFive
7 #ifdef CONFIG_XIP_KERNEL
8 #include "vmlinux-xip.lds.S"
11 #include <asm/pgtable.h>
12 #define LOAD_OFFSET KERNEL_LINK_ADDR
14 #include <asm/vmlinux.lds.h>
16 #include <asm/cache.h>
17 #include <asm/thread_info.h>
18 #include <asm/set_memory.h>
19 #include "image-vars.h"
21 #include <linux/sizes.h>
27 PECOFF_SECTION_ALIGNMENT = 0x1000;
28 PECOFF_FILE_ALIGNMENT = 0x200;
32 /* Beginning of code and text segment */
53 . = ALIGN(SECTION_ALIGN);
55 __init_text_begin = .;
56 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) ALIGN(SECTION_ALIGN) { \
63 __soc_early_init_table : {
64 __soc_early_init_table_start = .;
65 KEEP(*(__soc_early_init_table))
66 __soc_early_init_table_end = .;
68 __soc_builtin_dtb_table : {
69 __soc_builtin_dtb_table_start = .;
70 KEEP(*(__soc_builtin_dtb_table))
71 __soc_builtin_dtb_table_end = .;
73 /* 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 = .;
92 PERCPU_SECTION(L1_CACHE_BYTES)
108 /* Start of data section */
110 RO_DATA(SECTION_ALIGN)
115 EXCEPTION_TABLE(0x10)
117 . = ALIGN(SECTION_ALIGN);
120 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
122 __global_pointer$ = . + 0x800;
127 .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); }
128 __pecoff_data_raw_size = ABSOLUTE(. - __pecoff_text_end);
131 /* End of data section */
134 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
137 . = ALIGN(PECOFF_SECTION_ALIGNMENT);
138 __pecoff_data_virt_size = ABSOLUTE(. - __pecoff_text_end);
148 #endif /* CONFIG_XIP_KERNEL */