From 1f2fdbd0078cb2ad4251768e8c0e0bb652a2cbd6 Mon Sep 17 00:00:00 2001
From: Chris Zankel <chris@zankel.net>
Date: Mon, 15 Dec 2014 21:22:21 -0800
Subject: [PATCH] xtensa: disable link optimization

The default linker behavior is to optimize identical literal values
and remove unnecessary overhead. However, because of a bug in the
linker, this currently results in an error ('call target out of range').

Disable link-time optimizations per default until there is a fix
for the linker and add the option to iss_defconfig.

Signed-off-by: Chris Zankel <chris@zankel.net>
---
 arch/xtensa/Kconfig.debug         | 2 +-
 arch/xtensa/configs/iss_defconfig | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/xtensa/Kconfig.debug b/arch/xtensa/Kconfig.debug
index 53ae08eef86d5..8430af27de0a6 100644
--- a/arch/xtensa/Kconfig.debug
+++ b/arch/xtensa/Kconfig.debug
@@ -14,7 +14,7 @@ config DEBUG_TLB_SANITY
 
 config LD_NO_RELAX
 	bool "Disable linker relaxation"
-	default n
+	default y
 	help
 	  Enable this function to disable link-time optimizations.
 	  The default linker behavior is to combine identical literal
diff --git a/arch/xtensa/configs/iss_defconfig b/arch/xtensa/configs/iss_defconfig
index 6a7593b6784d2..e4d193e7a3008 100644
--- a/arch/xtensa/configs/iss_defconfig
+++ b/arch/xtensa/configs/iss_defconfig
@@ -757,3 +757,4 @@ CONFIG_GENERIC_FIND_LAST_BIT=y
 CONFIG_HAS_IOMEM=y
 CONFIG_HAS_DMA=y
 CONFIG_NLATTR=y
+CONFIG_LD_NO_RELAX=y
-- 
GitLab