diff --git a/Makefile.lib b/Makefile.lib index cae428d4..683a26f0 100644 --- a/Makefile.lib +++ b/Makefile.lib @@ -10,6 +10,8 @@ ARCHIVE ?= $(LIB_DIR)/build/$(NAME)-$(ARCH).a INC_DIR += $(addsuffix /include/, $(addprefix $(AM_HOME)/libs/, $(LIBS))) +CFLAGS += -fdata-sections -ffunction-sections + $(shell mkdir -p $(DST_DIR)) include $(AM_HOME)/Makefile.compile diff --git a/am/arch/mips32-minimal/img/build b/am/arch/mips32-minimal/img/build index bd1dd7f7..2a632c5b 100755 --- a/am/arch/mips32-minimal/img/build +++ b/am/arch/mips32-minimal/img/build @@ -6,4 +6,4 @@ shift bash -c "cd $DIR/boot && make" -mips-linux-gnu-ld -EL -T $DIR/loader.ld -e _start -o $DEST $DIR/boot/start.o $@ && python $DIR/gen_coe.py $DEST +mips-linux-gnu-ld --gc-sections -EL -T $DIR/loader.ld -e _start -o $DEST $DIR/boot/start.o $@ && python $DIR/gen_coe.py $DEST