From 25f5edabb5a719e24cc1865eb50b7894d0f976cf Mon Sep 17 00:00:00 2001 From: Carl van Schaik Date: Mon, 30 Nov 2015 12:39:59 +1100 Subject: [PATCH] arm64: place initial page tables in ELF section The swapper_pg_dir and idmap_pg_dir are placed above the kernel image, after the BSS. Currently, these are outside of any section in the ELF, which means a bootloader cannot from the ELF file alone determine where to place data (DTB etc). It needs to reserve an arbitarty space. This patch places the idmap_pd_dir and swapper_pg_dir symbols into a new .pg_dir section. With this defined, the bootloader can safely place images using addresses after the ELF. Signed-off-by: Carl van Schaik --- arch/arm64/kernel/vmlinux.lds.S | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S index a2c2986..759ae68 100644 --- a/arch/arm64/kernel/vmlinux.lds.S +++ b/arch/arm64/kernel/vmlinux.lds.S @@ -154,10 +154,12 @@ SECTIONS BSS_SECTION(0, 0, 0) . = ALIGN(PAGE_SIZE); - idmap_pg_dir = .; - . += IDMAP_DIR_SIZE; - swapper_pg_dir = .; - . += SWAPPER_DIR_SIZE; + .pg_dir : { + idmap_pg_dir = .; + . += IDMAP_DIR_SIZE; + swapper_pg_dir = .; + . += SWAPPER_DIR_SIZE; + } _end = .; -- 2.3.2