From f1ae5d40b4f35272247135d7bfe81ca80e5de90c Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Mon, 19 Jun 2017 10:20:41 -0700 Subject: [PATCH] linker-defs: add output section routing macros This is conditionally defined based on whether we are splitting the application from the kernel, and is used for specifying kernel input sections based on input files. The kernel output sections will get matching input sections only in libzephyr.a and kernel/lib.a. Signed-off-by: Andrew Boie --- include/linker/linker-defs.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linker/linker-defs.h b/include/linker/linker-defs.h index 76ad02dcc0d..810d7db9e99 100644 --- a/include/linker/linker-defs.h +++ b/include/linker/linker-defs.h @@ -101,6 +101,14 @@ KEEP(*(".shell_*")); \ __shell_cmd_end = .; +#ifdef CONFIG_APPLICATION_MEMORY +#define KERNEL_INPUT_SECTION(sect) libzephyr.a (sect) kernel/lib.a (sect) +#define APP_INPUT_SECTION(sect) EXCLUDE_FILE (*libzephyr.a *kernel/lib.a) *(sect) +#else +#define KERNEL_INPUT_SECTION(sect) *(sect) +#define APP_INPUT_SECTION(sect) *(sect) +#endif + #ifdef CONFIG_X86 /* LINKER FILES: defines used by linker script */ /* Should be moved to linker-common-defs.h */