]> xenbits.xensource.com Git - freebsd.git/commitdiff
loader: --gc-sections needs sections to work with
authortsoome <tsoome@FreeBSD.org>
Sun, 8 Sep 2019 19:39:45 +0000 (19:39 +0000)
committertsoome <tsoome@FreeBSD.org>
Sun, 8 Sep 2019 19:39:45 +0000 (19:39 +0000)
--gc-sections is not really useful unless we generate sections with
-ffunction-sections -fdata-sections

While there, i386/loader would win from --gc-sections too.

stand/defs.mk
stand/i386/loader/Makefile

index 9b5d7960e410f5647a5af3567f64bde6ab812b82..1d07cda40300a599d1aba035ce40d98e731d2d53 100644 (file)
@@ -65,6 +65,7 @@ CFLAGS+=      -Ddouble=jagged-little-pill -Dfloat=floaty-mcfloatface
 # Experience has shown that problems arise between ~520k to ~530k.
 CFLAGS.clang+= -Oz
 CFLAGS.gcc+=   -Os
+CFLAGS+=       -ffunction-sections -fdata-sections
 .endif
 
 # GELI Support, with backward compat hooks (mostly)
index dbb993eaad020096821878b4f62a0329bddf06ec..d0611ef6a4d96c44a520ac1fdf18f4316b41d4f6 100644 (file)
@@ -47,7 +47,7 @@ HELP_FILES=   ${.CURDIR}/help.i386
 CLEANFILES+=   ${LOADER} ${LOADER}.bin
 
 CFLAGS+=       -Wall
-LDFLAGS+=      -static -Ttext 0x0
+LDFLAGS+=      -static -Ttext 0x0 -Wl,--gc-sections
 
 # i386 standalone support library
 LIBI386=       ${BOOTOBJ}/i386/libi386/libi386.a