aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mach-exynos/spl_boot.c
diff options
context:
space:
mode:
authorMarek BehĂșn <marek.behun@nic.cz>2021-05-20 13:24:10 +0200
committerTom Rini <trini@konsulko.com>2021-05-24 14:21:30 -0400
commit86c5e21013d5efd895de9905a19893b4403e4642 (patch)
tree826e54e219b261f6d282c5f42d126276bc5af191 /arch/arm/mach-exynos/spl_boot.c
parent82b63e95410ebca0bbfd343ce163299a44a2d932 (diff)
downloadu-boot-86c5e21013d5efd895de9905a19893b4403e4642.zip
u-boot-86c5e21013d5efd895de9905a19893b4403e4642.tar.gz
u-boot-86c5e21013d5efd895de9905a19893b4403e4642.tar.bz2
ARM: make gd a function call for LTO and set via set_gd()
On ARM, the gd pointer is stored in registers r9 / x18. For this the -ffixed-r9 / -ffixed-x18 flag is used when compiling, but using global register variables causes errors when building with LTO, and these errors are very difficult to overcome. Richard Biener says [1]: Note that global register vars shouldn't be used with LTO and if they are restricted to just a few compilation units the recommended fix is to build those CUs without -flto. We cannot do this for U-Boot since all CUs use -ffixed-reg flag. It seems that with LTO we could in fact store the gd pointer differently and gain performance or size benefit by allowing the compiler to use r9 / x18. But this would need more work. So for now, when building with LTO, go the clang way, and instead of declaring gd a global register variable, we make it a function call via macro. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68384 Signed-off-by: Marek BehĂșn <marek.behun@nic.cz> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/mach-exynos/spl_boot.c')
-rw-r--r--arch/arm/mach-exynos/spl_boot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-exynos/spl_boot.c b/arch/arm/mach-exynos/spl_boot.c
index 27f0dac..72244988 100644
--- a/arch/arm/mach-exynos/spl_boot.c
+++ b/arch/arm/mach-exynos/spl_boot.c
@@ -279,7 +279,7 @@ void memzero(void *s, size_t n)
*/
static void setup_global_data(gd_t *gdp)
{
- gd = gdp;
+ set_gd(gdp);
memzero((void *)gd, sizeof(gd_t));
gd->flags |= GD_FLG_RELOC;
gd->baudrate = CONFIG_BAUDRATE;