public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5 1/2] spl: fix linker size check off-by-one errors
Date: Sat, 27 Apr 2019 22:17:41 +0200	[thread overview]
Message-ID: <8d9de88c-8359-193f-66a1-c98ed07a9906@gmail.com> (raw)
In-Reply-To: <20190425192240.5925-1-simon.k.r.goldschmidt@gmail.com>



On 25.04.19 21:22, Simon Goldschmidt wrote:
> This fixes SPL linker script size checks for 3 lds files where the size
> checks were implemented as "x < YYY_MAX_SIZE".
> 
> Fix the size checks to be "x <= YYY_MAX_SIZE" instead.

After updating Ubuntu to 19.04 today, the new 8.3 gcc makes 
smartweb_defconfig fail compiling SPL without this because 
__image_copy_end==0x1000

I guess we're lucky travis uses gcc 7.3... (or, are we?)

Regards,
Simon

> 
> Signed-off-by: Simon Goldschmidt <simon.k.r.goldschmidt@gmail.com>
> ---
> 
> Changes in v5:
> - added patch to fix linker size checks off-by-one error
> 
>   arch/arm/cpu/u-boot-spl.lds                 | 6 +++---
>   arch/arm/mach-at91/arm926ejs/u-boot-spl.lds | 4 ++--
>   arch/microblaze/cpu/u-boot-spl.lds          | 2 +-
>   3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
> index a2aa93a735..97899a567f 100644
> --- a/arch/arm/cpu/u-boot-spl.lds
> +++ b/arch/arm/cpu/u-boot-spl.lds
> @@ -79,16 +79,16 @@ SECTIONS
>   }
>   
>   #if defined(IMAGE_MAX_SIZE)
> -ASSERT(__image_copy_end - __image_copy_start < (IMAGE_MAX_SIZE), \
> +ASSERT(__image_copy_end - __image_copy_start <= (IMAGE_MAX_SIZE), \
>   	"SPL image too big");
>   #endif
>   
>   #if defined(CONFIG_SPL_BSS_MAX_SIZE)
> -ASSERT(__bss_end - __bss_start < (CONFIG_SPL_BSS_MAX_SIZE), \
> +ASSERT(__bss_end - __bss_start <= (CONFIG_SPL_BSS_MAX_SIZE), \
>   	"SPL image BSS too big");
>   #endif
>   
>   #if defined(CONFIG_SPL_MAX_FOOTPRINT)
> -ASSERT(__bss_end - _start < (CONFIG_SPL_MAX_FOOTPRINT), \
> +ASSERT(__bss_end - _start <= (CONFIG_SPL_MAX_FOOTPRINT), \
>   	"SPL image plus BSS too big");
>   #endif
> diff --git a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
> index 3955bea23a..74f6355229 100644
> --- a/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
> +++ b/arch/arm/mach-at91/arm926ejs/u-boot-spl.lds
> @@ -52,11 +52,11 @@ SECTIONS
>   }
>   
>   #if defined(IMAGE_MAX_SIZE)
> -ASSERT(__image_copy_end - __start < (IMAGE_MAX_SIZE), \
> +ASSERT(__image_copy_end - __start <= (IMAGE_MAX_SIZE), \
>   	"SPL image too big");
>   #endif
>   
>   #if defined(CONFIG_SPL_BSS_MAX_SIZE)
> -ASSERT(__bss_end - __bss_start < (CONFIG_SPL_BSS_MAX_SIZE), \
> +ASSERT(__bss_end - __bss_start <= (CONFIG_SPL_BSS_MAX_SIZE), \
>   	"SPL image BSS too big");
>   #endif
> diff --git a/arch/microblaze/cpu/u-boot-spl.lds b/arch/microblaze/cpu/u-boot-spl.lds
> index 99c62b51a1..3387eb7189 100644
> --- a/arch/microblaze/cpu/u-boot-spl.lds
> +++ b/arch/microblaze/cpu/u-boot-spl.lds
> @@ -57,6 +57,6 @@ SECTIONS
>   }
>   
>   #if defined(CONFIG_SPL_MAX_FOOTPRINT)
> -ASSERT(__end - _start < (CONFIG_SPL_MAX_FOOTPRINT), \
> +ASSERT(__end - _start <= (CONFIG_SPL_MAX_FOOTPRINT), \
>           "SPL image plus BSS too big");
>   #endif
> 

  parent reply	other threads:[~2019-04-27 20:17 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-25 19:22 [U-Boot] [PATCH v5 1/2] spl: fix linker size check off-by-one errors Simon Goldschmidt
2019-04-25 19:22 ` [U-Boot] [PATCH v5 2/2] dlmalloc: fix malloc range at end of ram Simon Goldschmidt
2019-04-25 22:22   ` Marek Vasut
2019-04-26  6:19     ` Simon Goldschmidt
2019-04-26  9:32       ` Marek Vasut
2019-04-26  9:36         ` Simon Goldschmidt
2019-04-26  9:56           ` Marek Vasut
2019-04-26 10:19             ` Simon Goldschmidt
2019-04-26 11:00               ` Marek Vasut
2019-05-04 18:16                 ` Simon Goldschmidt
2019-05-05 11:38                   ` Tom Rini
2019-05-05 17:55                     ` Simon Goldschmidt
2019-05-05 18:12                       ` Tom Rini
2019-04-27 20:17 ` Simon Goldschmidt [this message]
2019-05-06 11:14 ` [U-Boot] [PATCH v5 1/2] spl: fix linker size check off-by-one errors Tom Rini

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=8d9de88c-8359-193f-66a1-c98ed07a9906@gmail.com \
    --to=simon.k.r.goldschmidt@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox