1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2012 Regents of the University of California
4 * Copyright (C) 2017 SiFive
5 * Copyright (C) 2020 Vitaly Wool, Konsulko AB
8 #include <asm/pgtable.h>
9 #define LOAD_OFFSET KERNEL_LINK_ADDR
10 /* No __ro_after_init data in the .rodata section - which will always be ro */
11 #define RO_AFTER_INIT_DATA
13 #include <asm/vmlinux.lds.h>
15 #include <asm/cache.h>
16 #include <asm/thread_info.h>
25 /* Beginning of code and text segment */
30 INIT_TEXT_SECTION(PAGE_SIZE)
31 /* we have to discard exit text and such at runtime, not link time */
50 RO_DATA(L1_CACHE_BYTES)
60 _exiprom = .; /* End of XIP ROM area */
64 * From this point, stuff is considered writable and will be copied to RAM
66 __data_loc = ALIGN(PAGE_SIZE); /* location in file */
67 . = KERNEL_LINK_ADDR + XIP_OFFSET; /* location in memory */
70 #define LOAD_OFFSET (KERNEL_LINK_ADDR + XIP_OFFSET - (__data_loc & XIP_OFFSET_MASK))
72 _sdata = .; /* Start of data section */
74 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
76 __start_ro_after_init = .;
77 .data.ro_after_init : AT(ADDR(.data.ro_after_init) - LOAD_OFFSET) {
78 *(.data..ro_after_init)
80 __end_ro_after_init = .;
91 __soc_early_init_table : {
92 __soc_early_init_table_start = .;
93 KEEP(*(__soc_early_init_table))
94 __soc_early_init_table_end = .;
96 __soc_builtin_dtb_table : {
97 __soc_builtin_dtb_table_start = .;
98 KEEP(*(__soc_builtin_dtb_table))
99 __soc_builtin_dtb_table_end = .;
112 __xip_traps_start = .;
117 . = ALIGN(PAGE_SIZE);
119 __global_pointer$ = . + 0x800;
124 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
126 PERCPU_SECTION(L1_CACHE_BYTES)
128 .rel.dyn : AT(ADDR(.rel.dyn) - LOAD_OFFSET) {
133 * End of copied data. We need a dummy section to get its LMA.
134 * Also located before final ALIGN() as trailing padding is not stored
135 * in the resulting binary file and useless to copy.
137 .data.endmark : AT(ADDR(.data.endmark) - LOAD_OFFSET) { }
138 _edata_loc = LOADADDR(.data.endmark);
140 . = ALIGN(PAGE_SIZE);