From owner-freebsd-current@FreeBSD.ORG Wed Sep 18 08:04:26 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 8FFB88C3; Wed, 18 Sep 2013 08:04:26 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 71DB82612; Wed, 18 Sep 2013 08:04:26 +0000 (UTC) Received: from bender.Home (97e5e46b.skybroadband.com [151.229.228.107]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 6D5D05DFFE; Wed, 18 Sep 2013 08:04:24 +0000 (UTC) Date: Wed, 18 Sep 2013 09:04:17 +0100 From: Andrew Turner To: Tim Kientzle Subject: Re: -ffunction-sections, -fdata-sections and -Wl,--gc-sections Message-ID: <20130918090417.73015751@bender.Home> In-Reply-To: References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Cc: Ed Schouten , FreeBSD Current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Sep 2013 08:04:26 -0000 On Sun, 15 Sep 2013 19:30:01 -0700 Tim Kientzle wrote: > > On Sep 15, 2013, at 2:24 PM, Ed Schouten wrote: > > GCC and Clang support the -ffunction-sections and -fdata-sections > > flags. Essentially, these flags force the compiler to put every > > function and variable in its own section. Though this will blow up > > the > …. > > - devd suddenly becomes 500 KB in size, instead of a megabyte, > > - init's size drops from 900 KB to 600 KB, > > Can you figure out what functions are getting omitted > when you make this change? You can add "-Wl,--print-gc-sections" to LDFLAGS to print which sections the linker is removing. Andrew