From 23ac79ff8011c290cc1755b8ab510df80e614db6 Mon Sep 17 00:00:00 2001 From: Christophe Leroy Date: Fri, 16 Mar 2018 17:20:53 +0100 Subject: common: env_embedded: allow fine placement of environment object Commit 7653942b10e9e ("common/env_embedded.c: drop support for CONFIG_SYS_USE_PPCENV") dropped the .ppcenv section which was used in linking scripts to allow fine placement of embedded environment sections. This implies that GCC randomly places objects from env/embedded.o and environment is not guaranteed to be located at the correct address: 04003df8 g F .text 00000038 mii_init 04004000 g O .text 00000004 env_size 04004004 g O .text 00002000 environment 04006004 g F .text 00000040 .hidden __lshrdi3 This patch restores this capability by allocating each object marked with __UBOOT_ENV_SECTION__ into a different section. Hence 'environment' will be alone in .text.environment, allowing a fine placement in u-boot.lds with: . = DEFINED(env_offset) ? env_offset : .; env/embedded.o (.text.environment) Fixes: 7653942b10e9e ("common/env_embedded.c: drop support for CONFIG_SYS_USE_PPCENV") Cc: Thomas Petazzoni Signed-off-by: Christophe Leroy --- include/env_default.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/env_default.h') diff --git a/include/env_default.h b/include/env_default.h index b574345af2..dd741315ba 100644 --- a/include/env_default.h +++ b/include/env_default.h @@ -11,7 +11,7 @@ #include #ifdef DEFAULT_ENV_INSTANCE_EMBEDDED -env_t environment __UBOOT_ENV_SECTION__ = { +env_t environment __UBOOT_ENV_SECTION__(environment) = { ENV_CRC, /* CRC Sum */ #ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT 1, /* Flags: valid */ -- cgit v1.2.3