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 */
52 RO_DATA(L1_CACHE_BYTES)
62 _exiprom = .; /* End of XIP ROM area */
66 * From this point, stuff is considered writable and will be copied to RAM
68 __data_loc = ALIGN(PAGE_SIZE); /* location in file */
69 . = KERNEL_LINK_ADDR + XIP_OFFSET; /* location in memory */
72 #define LOAD_OFFSET (KERNEL_LINK_ADDR + XIP_OFFSET - (__data_loc & XIP_OFFSET_MASK))
74 _sdata = .; /* Start of data section */
76 RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_SIZE)
78 __start_ro_after_init = .;
79 .data.ro_after_init : AT(ADDR(.data.ro_after_init) - LOAD_OFFSET) {
80 *(.data..ro_after_init)
82 __end_ro_after_init = .;
93 __soc_early_init_table : {
94 __soc_early_init_table_start = .;
95 KEEP(*(__soc_early_init_table))
96 __soc_early_init_table_end = .;
98 __soc_builtin_dtb_table : {
99 __soc_builtin_dtb_table_start = .;
100 KEEP(*(__soc_builtin_dtb_table))
101 __soc_builtin_dtb_table_end = .;
114 __xip_traps_start = .;
119 . = ALIGN(PAGE_SIZE);
121 __global_pointer$ = . + 0x800;
126 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
128 PERCPU_SECTION(L1_CACHE_BYTES)
130 .rel.dyn : AT(ADDR(.rel.dyn) - LOAD_OFFSET) {
135 * End of copied data. We need a dummy section to get its LMA.
136 * Also located before final ALIGN() as trailing padding is not stored
137 * in the resulting binary file and useless to copy.
139 .data.endmark : AT(ADDR(.data.endmark) - LOAD_OFFSET) { }
140 _edata_loc = LOADADDR(.data.endmark);
142 . = ALIGN(PAGE_SIZE);