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 16
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 */
55 . = ALIGN(SECTION_ALIGN);
57 __init_text_begin = .;
58 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) ALIGN(SECTION_ALIGN) { \
65 __soc_early_init_table : {
66 __soc_early_init_table_start = .;
67 KEEP(*(__soc_early_init_table))
68 __soc_early_init_table_end = .;
70 __soc_builtin_dtb_table : {
71 __soc_builtin_dtb_table_start = .;
72 KEEP(*(__soc_builtin_dtb_table))
73 __soc_builtin_dtb_table_end = .;
75 /* we have to discard exit text and such at runtime, not link time */
82 . = ALIGN(SECTION_ALIGN);
84 . = ALIGN(PECOFF_SECTION_ALIGNMENT);
85 __pecoff_text_end = .;
87 /* Start of init data section */
88 __init_data_begin = .;
94 PERCPU_SECTION(L1_CACHE_BYTES)
110 /* Start of data section */
112 RO_DATA(SECTION_ALIGN)
117 . = ALIGN(SECTION_ALIGN);
120 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN)
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 */