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>
17 #include <asm/set_memory.h>
26 /* Beginning of code and text segment */
31 INIT_TEXT_SECTION(PAGE_SIZE)
32 /* 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 . = ALIGN(SECTION_ALIGN); /* location in memory */
72 #define LOAD_OFFSET (KERNEL_LINK_ADDR + _sdata - __data_loc)
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 = .;
108 __xip_traps_start = .;
113 . = ALIGN(PAGE_SIZE);
115 __global_pointer$ = . + 0x800;
120 BSS_SECTION(PAGE_SIZE, PAGE_SIZE, 0)
122 PERCPU_SECTION(L1_CACHE_BYTES)
124 .rel.dyn : AT(ADDR(.rel.dyn) - LOAD_OFFSET) {
129 * End of copied data. We need a dummy section to get its LMA.
130 * Also located before final ALIGN() as trailing padding is not stored
131 * in the resulting binary file and useless to copy.
133 .data.endmark : AT(ADDR(.data.endmark) - LOAD_OFFSET) { }
134 _edata_loc = LOADADDR(.data.endmark);
136 . = ALIGN(PAGE_SIZE);