From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aneesh V Date: Thu, 14 Jul 2011 11:07:26 +0530 Subject: [U-Boot] [RFC PATCH v1 3/9] Extend build-system for SPL framework In-Reply-To: <1310569869-31810-4-git-send-email-daniel.schwierzeck@googlemail.com> References: <4DF9B9E0.8020206@ti.com> <1310569869-31810-1-git-send-email-daniel.schwierzeck@googlemail.com> <1310569869-31810-4-git-send-email-daniel.schwierzeck@googlemail.com> Message-ID: <4E1E8096.2000307@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Wolfgang, On Wednesday 13 July 2011 08:41 PM, Daniel Schwierzeck wrote: [snip ..] > gccincdir := $(shell $(CC) -print-file-name=include) > > +# Use section garbage collect for SPL if enabled by board config > +# and current ARCH, CPU or SOC did not enable it already > +ifeq ($(CONFIG_SPL_BUILD),y) > +ifeq ($(CONFIG_SPL_GC_SECTIONS),y) > +RELFLAGS += -ffunction-sections -fdata-sections > +LDFLAGS_FINAL += --gc-sections We were not sure whether to globally enable --gc-sections unconditionally for SPL or not. My opinion is that these flags should be globally enabled for all SPLs for the following reasons: 1. We chose only a few essential files per library for building the SPL libraries. There may be undefined references from some of the functions in the selected files to other files in the library. The functions that have these undefined references are those that are eventually not used by SPL. To avoid these linking errors we need --gc-sections 2. On the other hand if we built the libraries with all the files just as you would do in u-boot, we will definitely over step the internal RAM budget. So, in this case also we will need --gc-sections. As such I propose that the above shall be made un-conditional after taking care not to duplicate it if it's already defined in the platform config.mk for the u-boot. What do you think? best regards, Aneesh