From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Mon, 8 Apr 2013 21:03:05 +0200 Subject: [U-Boot] [PATCH] ARM: Fix __bss_start and __bss_end in linker scripts In-Reply-To: <20130405202330.GL32357@bill-the-cat> References: <20130405015438.1382cb09@lilith> <1130429503.1176502.1365133495160.JavaMail.root@advansee.com> <20130405080043.531e1b3d@lilith> <300263803.1207216.1365170206861.JavaMail.root@advansee.com> <20130405160030.GG32357@bill-the-cat> <30209879.1303556.1365183174121.JavaMail.root@advansee.com> <20130405175521.GI32357@bill-the-cat> <20130405211740.72080ec0@lilith> <20130405194408.GK32357@bill-the-cat> <20130405220402.0a054204@lilith> <20130405202330.GL32357@bill-the-cat> Message-ID: <20130408210305.4f1cc319@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Tom, On Fri, 5 Apr 2013 16:23:30 -0400, Tom Rini wrote: > On Fri, Apr 05, 2013 at 10:04:02PM +0200, Albert ARIBAUD wrote: > > > The two general ideas of my proposal are: > > > > 1) to separate testing the image (text,data,rodata,lists) size on the > > one hand and the image BSS size on the other hand, and > > > > 2) to consider that if a target defines an image max size and a BSS > > max size, then the image max size does not include the BSS size ; and > > if it defined an image max size but no BSS max size, then the image max > > size includes the BSS. > > > > The first idea allows boards with disjoint image and BSS to still check > > eahc part's size, a thing not feasible with the current code; the > > second idea allows fewer changes, but if one wants CONFIG_SPL_MAX_SIZE > > to have a strict meaning, we can drop idea #2 and still keep idea #1. > > Make it so, thanks! Just a quick heads up: in the little time I could spare this week-end, I analyzed the SPL image vs BSS max sizes issue, and the following appeared: 1. File arch/arm/cpu/u-boot.lds has an ASSERT() regarding SPL even though it is never used for building SPL (tested by replacing the ASSERT() condition by 0 and building all of ARM). 2. Several boards use arch/arm/cpu/u-boot-spl.lds, which has an ASSERT() wrongly comparing image+BSS size to image-only CONFIG_SPL_MAX_SIZE. Fixing the linker file will fix all tegra boards as well as the exynos origen and smdkv310. Note: the tegra-common.h config file states a non-existent .lds file for SPL. 3. Boards cam_enc_4xx, da850evm, smdk5250 and snow all define maximum SPL size to include image and BSS. These must be split arbitrarily; I have chosen values that fit sizes from current build results. 4. Boards MPC8313ERDB_[NAND_]{33,66} hardcode their image+BSS limit. I have left this untouched. 5. Board a3m071 and its linker file define CONFIG_SYS_SPL_MAX_LEN instead of CONFIG_SPL_MAX_SIZE, but the semantics are correct. Left unchanged. 6. Generic p1_p2_rdb_pc board header defines CONFIG_SPL_MAX_SIZE but linker files do not seem to test it anyway. Left unchanged. 7. Tegra configs specify a non-existent lds file name. Build defaults to generic ARM lds file. Left unchanged. Patch series to follow in a couple of hours. Amicalement, -- Albert.