u-boot/env
Christophe Leroy 23ac79ff80 common: env_embedded: allow fine placement of environment object
Commit 7653942b10 ("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: 7653942b10 ("common/env_embedded.c: drop support for CONFIG_SYS_USE_PPCENV")
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
2018-04-06 16:30:37 -04:00
..
attr.c Move environment files from common/ to env/ 2017-08-15 08:18:45 -04:00
callback.c env: Rename getenv/_f() to env_get() 2017-08-16 08:30:24 -04:00
common.c env: move more common code to env_import_redund 2018-02-01 08:05:49 -05:00
eeprom.c env: restore old env_get_char() behaviour 2018-02-16 11:12:42 -05:00
embedded.c common: env_embedded: allow fine placement of environment object 2018-04-06 16:30:37 -04:00
env.c env: restore old env_get_char() behaviour 2018-02-16 11:12:42 -05:00
ext4.c env: mmc/fat/ext4: make sure that the MMC sub-system is initialized before using it 2018-02-20 08:21:30 -05:00
fat.c env: mmc/fat/ext4: make sure that the MMC sub-system is initialized before using it 2018-02-20 08:21:30 -05:00
flags.c env: Rename some other getenv()-related functions 2017-08-16 08:31:11 -04:00
flash.c env: make env drivers propagate env_import return value 2018-02-01 08:05:53 -05:00
Kconfig Merge git://git.denx.de/u-boot-sunxi 2018-04-04 14:10:39 -04:00
Makefile env: Drop CONFIG_ENV_IS_IN_DATAFLASH 2017-10-16 09:42:51 -04:00
mmc.c env: mmc/fat/ext4: make sure that the MMC sub-system is initialized before using it 2018-02-20 08:21:30 -05:00
nand.c env: make env drivers propagate env_import return value 2018-02-01 08:05:53 -05:00
nowhere.c env: Correct case of no sub-init function 2017-08-20 19:27:28 -04:00
nvram.c env: restore old env_get_char() behaviour 2018-02-16 11:12:42 -05:00
onenand.c env: make env_import(_redund) return 0 on success, not 1 2018-01-31 18:45:10 -05:00
remote.c env: make env drivers propagate env_import return value 2018-02-01 08:05:53 -05:00
sata.c env: make env drivers propagate env_import return value 2018-02-01 08:05:53 -05:00
sf.c env: sf: use env_import_redund to simplify env_sf_load 2018-02-01 08:05:53 -05:00
ubi.c env: make env drivers propagate env_import return value 2018-02-01 08:05:53 -05:00