summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2018-05-09 22:59:59 +1000
committerMasahiro Yamada <yamada.masahiro@socionext.com>2018-05-17 22:45:00 +0900
commit6ca8d9433d7712d4c3c6102816b685470504dc3d (patch)
treed5a9dac5ce28074424da701139fe0d6e0dc853a3 /Makefile
parent266ff2a8f51f02b429a987d87634697eb0d01d6a (diff)
downloadlinux-6ca8d9433d7712d4c3c6102816b685470504dc3d.tar.gz
linux-6ca8d9433d7712d4c3c6102816b685470504dc3d.tar.bz2
linux-6ca8d9433d7712d4c3c6102816b685470504dc3d.zip
kbuild: LD_DEAD_CODE_DATA_ELIMINATION no -ffunction-sections/-fdata-sections for module build
Modules do not tend to cope with -ffunction-sections, even though they do not link with -gc-sections. It may be possible for unused symbols to be trimmed from modules, but in general that would take much more work in architecture module linker scripts. For now, enable these only for kernel build. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a1ea84dfdde6..52ea534f5173 100644
--- a/Makefile
+++ b/Makefile
@@ -799,8 +799,8 @@ KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
endif
ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
-KBUILD_CFLAGS += $(call cc-option,-ffunction-sections,)
-KBUILD_CFLAGS += $(call cc-option,-fdata-sections,)
+KBUILD_CFLAGS_KERNEL += $(call cc-option,-ffunction-sections,)
+KBUILD_CFLAGS_KERNEL += $(call cc-option,-fdata-sections,)
endif
# arch Makefile may override CC so keep this after arch Makefile is included