]> git.baikalelectronics.ru Git - kernel.git/commit
riscv: add alignment for text, rodata and data sections
authorZong Li <zong.li@sifive.com>
Mon, 9 Mar 2020 16:55:40 +0000 (00:55 +0800)
committerPalmer Dabbelt <palmerdabbelt@google.com>
Thu, 26 Mar 2020 16:24:42 +0000 (09:24 -0700)
commit0a338eb3fc8008eb807ecfe84250839f9ed4c4b8
treec5a3b7c169462d455d6a96c990b45a7ece963fbd
parentc4cef03729a25769ff7660db2116d20c105c51c2
riscv: add alignment for text, rodata and data sections

The kernel mapping will tried to optimize its mapping by using bigger
size. In rv64, it tries to use PMD_SIZE, and tryies to use PGDIR_SIZE in
rv32. To ensure that the start address of these sections could fit the
mapping entry size, make them align to the biggest alignment.

Define a macro SECTION_ALIGN because the HPAGE_SIZE or PMD_SIZE, etc.,
are invisible in linker script.

This patch is prepared for STRICT_KERNEL_RWX support.

Signed-off-by: Zong Li <zong.li@sifive.com>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
arch/riscv/include/asm/set_memory.h
arch/riscv/kernel/vmlinux.lds.S