File tree Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Expand file tree Collapse file tree 3 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 107107
108108#endif
109109
110- #ifdef CONFIG_XIP_KERNEL
111- #define XIP_OFFSET SZ_32M
112- #define XIP_OFFSET_MASK (SZ_32M - 1)
113- #else
114- #define XIP_OFFSET 0
115- #endif
116-
117110#ifndef __ASSEMBLY__
118111
119112#include <asm/page.h>
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ bool kernel_page_present(struct page *page);
4646
4747#endif /* __ASSEMBLY__ */
4848
49- #ifdef CONFIG_STRICT_KERNEL_RWX
49+ #if defined( CONFIG_STRICT_KERNEL_RWX ) || defined( CONFIG_XIP_KERNEL )
5050#ifdef CONFIG_64BIT
5151#define SECTION_ALIGN (1 << 21)
5252#else
Original file line number Diff line number Diff line change 1414#include <asm/page.h>
1515#include <asm/cache.h>
1616#include <asm/thread_info.h>
17+ #include <asm/set_memory.h>
1718
1819OUTPUT_ARCH(riscv)
1920ENTRY(_start)
@@ -65,10 +66,10 @@ SECTIONS
6566 * From this point, stuff is considered writable and will be copied to RAM
6667 */
6768 __data_loc = ALIGN(PAGE_SIZE); /* location in file */
68- . = KERNEL_LINK_ADDR + XIP_OFFSET; /* location in memory */
69+ . = ALIGN(SECTION_ALIGN); /* location in memory */
6970
7071#undef LOAD_OFFSET
71- #define LOAD_OFFSET (KERNEL_LINK_ADDR + XIP_OFFSET - ( __data_loc & XIP_OFFSET_MASK) )
72+ #define LOAD_OFFSET (KERNEL_LINK_ADDR + _sdata - __data_loc)
7273
7374 _sdata = .; /* Start of data section */
7475 _data = .;
You can’t perform that action at this time.
0 commit comments