kernel: use -ffunction-sections, -fdata-sections and --gc-sections on mips

in combination with kernel symbol export stripping this significantly reduces
the kernel image size

SVN-Revision: 35320
This commit is contained in:
Felix Fietkau
2013-01-26 16:26:13 +00:00
parent 7809d73fd2
commit 8933b918cd
52 changed files with 864 additions and 135 deletions

View File

@@ -81,15 +81,11 @@ define BuildKernel
( \
echo '#define SYMTAB_KEEP \'; \
cat $(KERNEL_BUILD_DIR)/sym_include.txt | \
awk '{print "*(___ksymtab+" $$$$1 ") \\" }'; \
awk '{print "KEEP(*(___ksymtab+" $$$$1 ")) \\" }'; \
echo; \
echo '#define SYMTAB_KEEP_GPL \'; \
cat $(KERNEL_BUILD_DIR)/sym_include.txt | \
awk '{print "*(___ksymtab_gpl+" $$$$1 ") \\" }'; \
echo; \
echo '#define SYMTAB_KEEP_STR \'; \
cat $(KERNEL_BUILD_DIR)/sym_include.txt | \
awk '{print "*(__ksymtab_strings." $$$$1 ") \\" }'; \
awk '{print "KEEP(*(___ksymtab_gpl+" $$$$1 ")) \\" }'; \
echo; \
echo '#define SYMTAB_DISCARD \'; \
cat $(KERNEL_BUILD_DIR)/sym_exclude.txt | \
@@ -99,10 +95,6 @@ define BuildKernel
cat $(KERNEL_BUILD_DIR)/sym_exclude.txt | \
awk '{print "*(___ksymtab_gpl+" $$$$1 ") \\" }'; \
echo; \
echo '#define SYMTAB_DISCARD_STR \'; \
cat $(KERNEL_BUILD_DIR)/sym_exclude.txt | \
awk '{print "*(__ksymtab_strings." $$$$1 ") \\" }'; \
echo; \
) > $$@
$(STAMP_CONFIGURED): $(STAMP_PREPARED) $(LINUX_KCONFIG_LIST) $(TOPDIR)/.config