All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/4] ARM: tegra: check for SPL size overflow in makefile
Date: Wed, 17 Oct 2012 21:18:58 -0600	[thread overview]
Message-ID: <507F7522.5040901@wwwdotorg.org> (raw)
In-Reply-To: <CAPnjgZ0Hb7g3O0zvk53cf6PR2cndcAWmdaxod6nyDiEfCVi3Jw@mail.gmail.com>

On 10/17/2012 06:03 PM, Simon Glass wrote:
> Hi Stephen,
> 
> On Tue, Oct 16, 2012 at 2:50 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> If the SPL extends beyond CONFIG_SYS_TEXT_BASE, then it will likely
>> corrupt the main U-Boot binary during execution, causing the main U-Boot
>> binary to fail. Check for this situation during the build to avoid
>> extremely annoying and hard-to-find bugs. Note that checking the size of
>> u-boot-spl.bin is not enough, since BSS size doesn't affect the size of
>> u-boot-spl.bin.

>> diff --git a/Makefile b/Makefile

>>  $(obj)u-boot-$(nodtb)-tegra.bin: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin $(dtbfile)
>> +               ebss=`${CROSS_COMPILE}objdump -t spl/u-boot-spl|awk '/__bss_end__/ {print "0x"$$1}'` ; \
>> +               if [ $$(($$ebss)) -gt $$(($(CONFIG_SYS_TEXT_BASE))) ]; then \
>> +                       echo ERROR: SPL BSS ends beyond CONFIG_SYS_TEXT_BASE > /dev/stderr; \
>> +                       exit 1; \
>> +               fi
> 
> Just wanted to check that this works ok for hex values?

Yes, the reason I used $(( )) around the value is because it was hex, so
I needed to convert it to an integer for -gt.

  reply	other threads:[~2012-10-18  3:18 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-16 21:50 [U-Boot] [PATCH 1/4] ARM: fix u-boot.lds for -ffunction-sections/-fdata-sections Stephen Warren
2012-10-16 21:50 ` [U-Boot] [PATCH 2/4] ARM: tegra: combine duplicate Makefile rules Stephen Warren
2012-10-18  0:01   ` Simon Glass
2012-10-16 21:50 ` [U-Boot] [PATCH 3/4] ARM: tegra: check for SPL size overflow in makefile Stephen Warren
2012-10-18  0:03   ` Simon Glass
2012-10-18  3:18     ` Stephen Warren [this message]
2012-10-18 16:27   ` Tom Rini
2012-10-18 20:45     ` Stephen Warren
2012-10-18 20:50       ` Tom Rini
2012-10-16 21:50 ` [U-Boot] [PATCH 4/4] ARM: tegra: increase CONFIG_SYS_TEXT_BASE Stephen Warren
2012-10-16 22:09   ` Lucas Stach
2012-10-16 22:43     ` Stephen Warren
2012-10-18  0:05       ` Simon Glass
2012-10-18  3:20         ` Stephen Warren
2012-10-18 16:31           ` Tom Rini
2012-10-18 20:42             ` Stephen Warren
2012-10-17 23:58 ` [U-Boot] [PATCH 1/4] ARM: fix u-boot.lds for -ffunction-sections/-fdata-sections Simon Glass
2012-10-18  3:17   ` Stephen Warren
2012-10-18 20:36     ` Albert ARIBAUD
2012-10-18 20:58       ` Stephen Warren
2012-10-18 21:17         ` Stephen Warren
2012-10-20 10:31           ` Albert ARIBAUD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=507F7522.5040901@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.