From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eugeniu Rosca Date: Fri, 24 May 2019 21:59:16 +0200 Subject: [U-Boot] Making U-Boot smaller In-Reply-To: <20190522185058.GW22232@bill-the-cat> References: <20190521195311.GP22232@bill-the-cat> <21ce98e8-d687-14dc-5023-d7e005cf5c74@denx.de> <20190521195915.GQ22232@bill-the-cat> <2989d436-5cbd-5b1a-9bdd-14b7b0770e4a@denx.de> <20190521201003.GR22232@bill-the-cat> <8fccaded-bf4c-63d1-2241-059c091f28cd@denx.de> <20190522150954.GT22232@bill-the-cat> <20190522165036.GA9229@x230> <20190522185058.GW22232@bill-the-cat> Message-ID: <20190524195916.GA12968@vmlxhi-102.adit-jv.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, May 22, 2019 at 02:50:58PM -0400, Tom Rini wrote: > On Wed, May 22, 2019 at 06:50:36PM +0200, Eugeniu Rosca wrote: [..] > > 0000000000000421 0000000000000024 T clk_free > > 0000000000000961 0000000000000027 T clk_disable > > 0000000000000888 0000000000000027 T clk_enable > > 0000000000000000 0000000000000027 T clk_request > > 0000000000000503 0000000000000027 T clk_set_parent > > 0000000000000445 0000000000000029 T clk_get_rate > > 0000000000000474 0000000000000029 T clk_set_rate > > Right. More numbers, and more easily readable is good. But to be > clear, since we use -ffunction-sections / -fdata-sections (and the > kernel doesn't normally), we get can get a lot more detail than I might > have implied. It's not just that you'll see that U-Boot shrank X bytes > with CONFIG_FEATURE_A disabled, it's that you'll see which functions > shrank by how much. Thanks for the useful highlights. > What we don't have is the link between > "CONFIG_OPTION_X" and "is part of functions A/B/C". Yes, that's the key part. I think the magnitude to have such a feature is reflected by the number of touched components: - Kconfig/Kbuild, and possibly additional components on top of these, to decide which line in the C file is guarded by which configuration - Compiler/linker to inject that information into the ELF files - readelf/nm, to avoid manual parsing of U-Boot map files A superhero or a motivated small team can possibly do it one day :-) > But we have a lot > of information like you would get out of nm already in u-boot*.map which > also includes "and we discarded these functions". -- Best Regards, Eugeniu.