diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2017-05-11 18:56:52 +0300 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2017-05-30 07:59:51 +0300 |
commit | efe0160cfd40a99c052a00e174787c1f4158a9cd (patch) | |
tree | 61f8f8ad39191e2bbc1980e2a493b63ddc79f397 /arch/powerpc/Makefile | |
parent | cde9f2f4207f769c0f8f0f53a431348ca6f3c182 (diff) | |
download | linux-efe0160cfd40a99c052a00e174787c1f4158a9cd.tar.xz |
powerpc/64: Linker on-demand sfpr functions for modules
For final link, the powerpc64 linker generates fpr save/restore
functions on-demand, placing them in the .sfpr section. Starting with
binutils 2.25, these can be provided for non-final links with
--save-restore-funcs. Use that where possible for module links.
This saves about 200 bytes per module (~60kB) on powernv defconfig
build.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/Makefile')
-rw-r--r-- | arch/powerpc/Makefile | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 3e0f0e1fadef..eaa1865e4a8d 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -189,7 +189,17 @@ else CHECKFLAGS += -D__LITTLE_ENDIAN__ endif +ifdef CONFIG_PPC32 KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o +else +ifeq ($(call ld-ifversion, -ge, 225000000, y),y) +# Have the linker provide sfpr if possible. +# There is a corresponding test in arch/powerpc/lib/Makefile +KBUILD_LDFLAGS_MODULE += --save-restore-funcs +else +KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o +endif +endif ifeq ($(CONFIG_476FPE_ERR46),y) KBUILD_LDFLAGS_MODULE += --ppc476-workaround \ |