From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Fri, 28 Jan 2011 12:58:39 -0600 Subject: [U-Boot] [PATCH 7/7] add gc-sections to TPL boot In-Reply-To: <1296240366.2918.104.camel@haiying-laptop> References: <1296190690-21146-1-git-send-email-Haiying.Wang@freescale.com> <1296190690-21146-5-git-send-email-Haiying.Wang@freescale.com> <20110128113646.4567b1fb@udp111988uds.am.freescale.net> <1296238110.2918.87.camel@haiying-laptop> <20110128123001.039ce7f6@udp111988uds.am.freescale.net> <1296240366.2918.104.camel@haiying-laptop> Message-ID: <20110128125839.209e4d5f@udp111988uds.am.freescale.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 28 Jan 2011 13:46:06 -0500 Haiying Wang wrote: > On Fri, 2011-01-28 at 12:30 -0600, Scott Wood wrote: > > I think --gc-sections should go in LDFLAGS_u-boot instead. > LDFLAGS_u-boot has --gc-sections already, I did not change it. It looks like LDFLAGS_u-boot may not be suitable for building SPL/TPL images. Since TPL is new, and we don't have to worry about breaking any existing boards, just unconditionally use --gc-sections when linking the final TPL image. Or, if we want a way for boards/cpus to add ld options that things like TPL use, introduce LDFLAGS_FINAL that holds ld parameters used for final link of any image, with LDFLAGS_u-boot holding things like text addresses and linker scripts with values that only apply to the main image. I'd prefer the latter approach, as we could make use of it in SPL as well, which does have existing boards to worry about. > > In any case, I don't think we want different behavior here based on > > whether we have TPL. Either LDFLAGS is used in partial linking, or > > it's not. > I don't understand why LDFLAGS was added here in patch > http://lists.denx.de/pipermail/u-boot/2011-January/084705.html > > It says "LDFLAGS sets necessary option by partial linking (use in > cmd_link_o_target)." But without this changing, the partial linking > worked well before. Please correct me if I am wrong. > > So if someone can confirm LDFLAGS is not necessary to be added in > cmd_link_o_target, I prefer not add it here. Whether leaving out -n during partial link worked for you or not, LDFLAGS is supposed to be used by partial links (that distinction is why LDFLAGS_u-boot was created). So don't put things in LDFPLAGS that break partial links. -Scott