kernel: generate placeholders for kobj tables before final build

Due to the use of gperf to generate hash table for kobjects,
the addresses of these kobjects cannot change during the last
few phases of linking (especially between zephyr_prebuilt.elf
and zephyr.elf). Because of this, the gperf generated data
needs to be placed at the end of memory to avoid pushing symbols
around in memory. This prevents moving these generated blocks
to earlier sections, for example, pinned data section needed
for demand paging. So create placeholders for use in
intermediate linking to reserve space for these generated blocks.
Due to uncertainty on the size of these blocks, more space is
being reserved which could result in wasted space. Though, this
retains the use of hash table for faster lookup.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2021-03-18 14:00:07 -07:00 committed by Anas Nashif
commit 1117169980
19 changed files with 488 additions and 97 deletions

View file

@ -188,7 +188,7 @@ SECTIONS {
__data_rom_start = LOADADDR(_DATA_SECTION_NAME);
#include <linker/common-ram.ld>
#include <linker/kobject.ld>
#include <linker/kobject-data.ld>
#ifdef __MWDT_LINKER_CMD__
/* TODO: add mwdt specific RAM C++ sections */

View file

@ -295,7 +295,7 @@ SECTIONS
__data_rom_start = LOADADDR(_DATA_SECTION_NAME);
#include <linker/common-ram.ld>
#include <linker/kobject.ld>
#include <linker/kobject-data.ld>
#include <linker/cplusplus-ram.ld>
__data_ram_end = .;

View file

@ -329,7 +329,7 @@ SECTIONS
__data_rom_start = LOADADDR(_DATA_SECTION_NAME);
#include <linker/common-ram.ld>
#include <linker/kobject.ld>
#include <linker/kobject-data.ld>
#include <linker/cplusplus-ram.ld>

View file

@ -271,7 +271,7 @@ SECTIONS
__data_rom_start = LOADADDR(_DATA_SECTION_NAME);
#include <linker/common-ram.ld>
#include <linker/kobject.ld>
#include <linker/kobject-data.ld>
#include <linker/cplusplus-ram.ld>
__data_ram_end = .;

View file

@ -225,7 +225,7 @@ SECTIONS
__data_rom_start = LOADADDR(_DATA_SECTION_NAME);
#include <linker/common-ram.ld>
#include <linker/kobject.ld>
#include <linker/kobject-data.ld>
/* Located in generated directory. This file is populated by the
* zephyr_linker_sources() Cmake function.

View file

@ -336,7 +336,7 @@ SECTIONS
#include <arch/x86/pagetables.ld>
/* Must be last in RAM */
#include <linker/kobject.ld>
#include <linker/kobject-data.ld>
MMU_PAGE_ALIGN
__data_ram_end = .;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 Intel Corp.
* Copyright (c) 2019-2021 Intel Corp.
* SPDX-License-Identifier: Apache-2.0
*/
@ -185,7 +185,7 @@ SECTIONS
#include <arch/x86/pagetables.ld>
/* Must be last in RAM */
#include <linker/kobject.ld>
#include <linker/kobject-data.ld>
MMU_PAGE_ALIGN
_image_ram_end = .;
z_mapped_end = .;