aboutsummaryrefslogtreecommitdiff
path: root/Makefile.main
diff options
context:
space:
mode:
authorMauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>2020-02-27 14:14:47 -0300
committerOliver O'Halloran <oohall@gmail.com>2020-06-03 17:15:50 +1000
commit22817f8d563a069fa9be5202095fd88ddadb21f6 (patch)
tree5075316ea1205cea8308f9ab1b98f8de86324880 /Makefile.main
parent9b6433c29fddac70eb7b18136b8b130a01c5dc47 (diff)
downloadskiboot-22817f8d563a069fa9be5202095fd88ddadb21f6.zip
skiboot-22817f8d563a069fa9be5202095fd88ddadb21f6.tar.gz
skiboot-22817f8d563a069fa9be5202095fd88ddadb21f6.tar.bz2
Honor DEAD_CODE_ELIMINATION flag
While trying to reduce the size of the final binary I found DEAD_CODE_ELIMINATION=1 but it didn't change the binary size and known ununsed functions were seen when inspecting the elf with nm. Even though the necessary parameters for compiler, -ffunction-sections and -fdata-sections, are set, ld's --gc-sections wasn't, so add it in order to honor the flag. Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'Makefile.main')
-rw-r--r--Makefile.main1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile.main b/Makefile.main
index dabd073..12aa253 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -181,6 +181,7 @@ endif
ifeq ($(DEAD_CODE_ELIMINATION),1)
LDFLAGS += -Wl,--gc-sections
+LDFLAGS_FINAL += --gc-sections
endif
AFLAGS := -D__ASSEMBLY__ -m64