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
9 #ifdef CONFIG_XIP_KERNEL
10 #include "vmlinux-xip.lds.S"
13 #include <asm/pgtable.h>
14 #define LOAD_OFFSET KERNEL_LINK_ADDR
16 #include <asm/vmlinux.lds.h>
18 #include <asm/cache.h>
19 #include <asm/thread_info.h>
20 #include <asm/set_memory.h>
21 #include "image-vars.h"
23 #include <linux/sizes.h>
29 PECOFF_SECTION_ALIGNMENT = 0x1000;
30 PECOFF_FILE_ALIGNMENT = 0x200;
34 /* Beginning of code and text segment */
54 . = ALIGN(SECTION_ALIGN);
56 __init_text_begin = .;
57 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) ALIGN(SECTION_ALIGN) { \
64 __soc_early_init_table : {
65 __soc_early_init_table_start = .;
66 KEEP(*(__soc_early_init_table))
67 __soc_early_init_table_end = .;
69 __soc_builtin_dtb_table : {
70 __soc_builtin_dtb_table_start = .;
71 KEEP(*(__soc_builtin_dtb_table))
72 __soc_builtin_dtb_table_end = .;
74 /* we have to discard exit text and such at runtime, not link time */
81 . = ALIGN(SECTION_ALIGN);
83 . = ALIGN(PECOFF_SECTION_ALIGNMENT);
84 __pecoff_text_end = .;
86 /* Start of init data section */
87 __init_data_begin = .;
93 PERCPU_SECTION(L1_CACHE_BYTES)
109 /* Start of data section */
111 RO_DATA(SECTION_ALIGN)
116 . = ALIGN(SECTION_ALIGN);
119 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN)
121 __global_pointer$ = . + 0x800;
126 .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); }
127 __pecoff_data_raw_size = ABSOLUTE(. - __pecoff_text_end);
130 /* End of data section */
133 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
136 . = ALIGN(PECOFF_SECTION_ALIGNMENT);
137 __pecoff_data_virt_size = ABSOLUTE(. - __pecoff_text_end);
147 #endif /* CONFIG_XIP_KERNEL */