* [PATCH v2 0/1] Fix SPL_EARLY_BSS applying to normal build
@ 2020-07-26 20:17 Brian Moyer
2020-07-26 20:17 ` [PATCH v2 1/1] arm: Add SPL build check to SPL early bss clear Brian Moyer
0 siblings, 1 reply; 3+ messages in thread
From: Brian Moyer @ 2020-07-26 20:17 UTC (permalink / raw)
To: u-boot
SPL_CLEAR_BSS is called regardless of build type if
CONFIG_SPL_EARLY_BSS is defined. This seems to break u-boot proper
and doesn't seem like the correct behavior.
Early bss clearing in u-boot proper happens before relocation and
causes lots of problems because .rel.dyn and .bss overlap.
Changes in v2:
- Adding a check to the first SPL_CLEAR_BSS resulted in BSS never
getting cleared for u-boot proper. Added an or condition to the
second call.
- SPL_CLEAR_BSS is the only bss clearing operation. Renamed to
just CLEAR_BSS for clarity.
Brian Moyer (1):
arm: Add SPL build check to SPL early bss clear
arch/arm/lib/crt0.S | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/1] arm: Add SPL build check to SPL early bss clear
2020-07-26 20:17 [PATCH v2 0/1] Fix SPL_EARLY_BSS applying to normal build Brian Moyer
@ 2020-07-26 20:17 ` Brian Moyer
2020-08-05 20:28 ` Tom Rini
0 siblings, 1 reply; 3+ messages in thread
From: Brian Moyer @ 2020-07-26 20:17 UTC (permalink / raw)
To: u-boot
SPL_CLEAR_BSS is called regardless of build type if
CONFIG_SPL_EARLY_BSS is defined. Add a guard for CONFIG_SPL_BUILD
to fix.
Signed-off-by: Brian Moyer <bdm310@gmail.com>
---
Changes in v2:
- Adding a check to the first SPL_CLEAR_BSS resulted in BSS never
getting cleared for u-boot proper. Added an or condition to the
second call.
- SPL_CLEAR_BSS is the only bss clearing operation. Renamed to
just CLEAR_BSS for clarity.
arch/arm/lib/crt0.S | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S
index df9dd83e40..46b6be21a8 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -64,7 +64,7 @@
* can afford it due to sufficient memory being available early.
*/
-.macro SPL_CLEAR_BSS
+.macro CLEAR_BSS
ldr r0, =__bss_start /* this is auto-relocated! */
#ifdef CONFIG_USE_ARCH_MEMSET
@@ -109,8 +109,8 @@ ENTRY(_main)
mov r9, r0
bl board_init_f_init_reserve
-#if defined(CONFIG_SPL_EARLY_BSS)
- SPL_CLEAR_BSS
+#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_EARLY_BSS)
+ CLEAR_BSS
#endif
mov r0, #0
@@ -150,8 +150,8 @@ here:
#endif
#if !defined(CONFIG_SPL_BUILD) || CONFIG_IS_ENABLED(FRAMEWORK)
-#if !defined(CONFIG_SPL_EARLY_BSS)
- SPL_CLEAR_BSS
+#if !defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SPL_EARLY_BSS)
+ CLEAR_BSS
#endif
# ifdef CONFIG_SPL_BUILD
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 1/1] arm: Add SPL build check to SPL early bss clear
2020-07-26 20:17 ` [PATCH v2 1/1] arm: Add SPL build check to SPL early bss clear Brian Moyer
@ 2020-08-05 20:28 ` Tom Rini
0 siblings, 0 replies; 3+ messages in thread
From: Tom Rini @ 2020-08-05 20:28 UTC (permalink / raw)
To: u-boot
On Sun, Jul 26, 2020 at 01:17:53PM -0700, Brian Moyer wrote:
> SPL_CLEAR_BSS is called regardless of build type if
> CONFIG_SPL_EARLY_BSS is defined. Add a guard for CONFIG_SPL_BUILD
> to fix.
>
> Signed-off-by: Brian Moyer <bdm310@gmail.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200805/90a729f5/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-05 20:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-26 20:17 [PATCH v2 0/1] Fix SPL_EARLY_BSS applying to normal build Brian Moyer
2020-07-26 20:17 ` [PATCH v2 1/1] arm: Add SPL build check to SPL early bss clear Brian Moyer
2020-08-05 20:28 ` Tom Rini
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.