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 */
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 . = ALIGN(SECTION_ALIGN);
118 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN)
120 __global_pointer$ = . + 0x800;
125 .pecoff_edata_padding : { BYTE(0); . = ALIGN(PECOFF_FILE_ALIGNMENT); }
126 __pecoff_data_raw_size = ABSOLUTE(. - __pecoff_text_end);
129 /* End of data section */
132 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
135 . = ALIGN(PECOFF_SECTION_ALIGNMENT);
136 __pecoff_data_virt_size = ABSOLUTE(. - __pecoff_text_end);
146 #endif /* CONFIG_XIP_KERNEL */