Skip to content

Commit

Permalink
xtensa: add config option to disable linker relaxation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Zankel committed Dec 19, 2012
1 parent 02b25d8 commit 6550162
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 11 additions & 2 deletions arch/xtensa/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 4 additions & 0 deletions arch/xtensa/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 6550162

Please sign in to comment.