mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] common: limit CONFIG_TEXT_BASE to 32-bit
@ 2023-06-05  6:28 Ahmad Fatoum
  2023-06-05 13:41 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-06-05  6:28 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The linker scripts fail in an odd way if CONFIG_TEXT_BASE doesn't
fit in 32-bit, e.g. reporting that the PBL is greater than
0xffffffff, because CONFIG_TEXT_BASE is bigger than that.

As new platform should just select CONFIG_PBL_RELOCATABLE and
CONFIG_RELOCATABLE anyway, let's enforce the 32-bit maximum in
Kconfig to make errors easier to grok.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/Kconfig | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/common/Kconfig b/common/Kconfig
index 5346ba5a623c..11aabbb509df 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -198,9 +198,13 @@ config TEXT_BASE
 	depends on HAVE_CONFIGURABLE_TEXT_BASE
 	prompt "TEXT_BASE"
 	hex
+	range 0 0xffffffff
 	default ARCH_TEXT_BASE
 	help
-	  The Address barebox gets linked at.
+	  The 32-bit address barebox gets linked at. This is forced
+	  to zero for relocatable barebox and fixed up at runtime,
+	  so barebox is executable on arbitrary addresses (given
+	  sufficient alignment).
 
 config BAREBOX_MAX_IMAGE_SIZE
 	prompt "Maximum size of barebox"
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] common: limit CONFIG_TEXT_BASE to 32-bit
  2023-06-05  6:28 [PATCH] common: limit CONFIG_TEXT_BASE to 32-bit Ahmad Fatoum
@ 2023-06-05 13:41 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2023-06-05 13:41 UTC (permalink / raw)
  To: Ahmad Fatoum; +Cc: barebox

On Mon, Jun 05, 2023 at 08:28:03AM +0200, Ahmad Fatoum wrote:
> The linker scripts fail in an odd way if CONFIG_TEXT_BASE doesn't
> fit in 32-bit, e.g. reporting that the PBL is greater than
> 0xffffffff, because CONFIG_TEXT_BASE is bigger than that.
> 
> As new platform should just select CONFIG_PBL_RELOCATABLE and
> CONFIG_RELOCATABLE anyway, let's enforce the 32-bit maximum in
> Kconfig to make errors easier to grok.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  common/Kconfig | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Applied, thanks

Sascha

> 
> diff --git a/common/Kconfig b/common/Kconfig
> index 5346ba5a623c..11aabbb509df 100644
> --- a/common/Kconfig
> +++ b/common/Kconfig
> @@ -198,9 +198,13 @@ config TEXT_BASE
>  	depends on HAVE_CONFIGURABLE_TEXT_BASE
>  	prompt "TEXT_BASE"
>  	hex
> +	range 0 0xffffffff
>  	default ARCH_TEXT_BASE
>  	help
> -	  The Address barebox gets linked at.
> +	  The 32-bit address barebox gets linked at. This is forced
> +	  to zero for relocatable barebox and fixed up at runtime,
> +	  so barebox is executable on arbitrary addresses (given
> +	  sufficient alignment).
>  
>  config BAREBOX_MAX_IMAGE_SIZE
>  	prompt "Maximum size of barebox"
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-05 13:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-05  6:28 [PATCH] common: limit CONFIG_TEXT_BASE to 32-bit Ahmad Fatoum
2023-06-05 13:41 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox