From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Tue, 18 Sep 2012 21:19:40 +0200 Subject: [U-Boot] [PATCH 62/71] serial: spl: Implement empty functions for SPL In-Reply-To: <5058BFE6.8050400@ti.com> References: <1347992734.15284.9@snotra> <201209182033.11689.marex@denx.de> <5058BFE6.8050400@ti.com> Message-ID: <201209182119.41080.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Tom Rini, > On 09/18/12 11:33, Marek Vasut wrote: > > Dear Scott Wood, > > [snip] > > >> I think I got some wires crossed and was thinking about > >> printf/puts. We want those to be optimized away at compile time > >> (not pointed to a stub at link time) on an SPL that has no output > >> support, but once that's done the low level serial functions > >> shouldn't be referenced anymore, right? > > > > But if you point them to stubs, that's OK. The compiler will GC > > these useless stubs anyway. But wait, we're getting to LTO here, > > right? > > > > So the safest bet really is macro in serial.h ? > > Due to the gcc bug I've mentioned before, yes. Dummy functions will, > I bet, keep the string constants around. do {} while(0) will drop > them out entirely. Damn, not much gain on m28evk (with C functionss/with macros), using gcc 4.7.1: Configuring for m28evk board... text data bss dec hex filename 418994 7780 288632 715406 aea8e ./u-boot 11773 788 12 12573 311d ./spl/u-boot-spl Configuring for m28evk board... text data bss dec hex filename 418998 7780 288628 715406 aea8e ./u-boot 11765 788 12 12565 3115 ./spl/u-boot-spl Best regards, Marek Vasut