Bladeren bron

xtensa: add config option to disable linker relaxation

The default linker behavior is to optimize identical literal values and
remove unnecessary overhead from assembler-generated "longcall" sequences
to reduce code size. Provide an option to disable this behavior to improve
compile time.

Signed-off-by: Chris Zankel <chris@zankel.net>
Chris Zankel 12 jaren geleden
bovenliggende
commit
6550162200
2 gewijzigde bestanden met toevoegingen van 15 en 2 verwijderingen
  1. 11 2
      arch/xtensa/Kconfig.debug
  2. 4 0
      arch/xtensa/Makefile

+ 11 - 2
arch/xtensa/Kconfig.debug

@@ -2,6 +2,15 @@ menu "Kernel hacking"
 
 source "lib/Kconfig.debug"
 
-endmenu
-
+config LD_NO_RELAX
+	bool "Disable linker relaxation"
+	default n
+	help
+	  Enable this function to disable link-time optimizations.
+	  The default linker behavior is to combine identical literal
+	  values to reduce code size and remove unnecessary overhead from
+	  assembler-generated 'longcall' sequences.
+	  Enabling this option improves the link time but increases the
+	  code size, and possibly execution time.
 
+endmenu

+ 4 - 0
arch/xtensa/Makefile

@@ -49,6 +49,10 @@ KBUILD_CFLAGS += -pipe -mlongcalls
 
 KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
 
+ifneq ($(CONFIG_LD_NO_RELAX),)
+LDFLAGS := --no-relax
+endif
+
 vardirs := $(patsubst %,arch/xtensa/variants/%/,$(variant-y))
 plfdirs := $(patsubst %,arch/xtensa/platforms/%/,$(platform-y))