[PATCH v2 6/7] aspeed/spl: Remove OVERLAY from linker script

Joel Stanley joel at jms.id.au
Wed Jun 29 09:05:24 CEST 2022


The generic arm linker script contains this section:

   .bss __rel_dyn_start (OVERLAY) : {
       ...
   }

The (OVERLAY) syntax in the description causes the .bss section to be
included in the NOR area of the image:

 $ objdump -t -j .bss spl/u-boot-spl
  SYMBOL TABLE:
  0000c61c l    d  .bss	00000000 .bss
  0000c640 l     O .bss	00000040 __value.0
  0000c68c g     O .bss	00000000 __bss_end
  0000c61c g     O .bss	00000000 __bss_start
  0000c680 g     O .bss	0000000c stdio_devices

This is what the custom linker script tries to avoid, as the NOR area is
read-only.

Remove the OVERLAY syntax to fix the BSS location:

 $ objdump -t -j .bss spl/u-boot-spl
  SYMBOL TABLE:
  83000000 l    d  .bss	00000000 .bss
  83000000 l     O .bss	00000040 __value.0
  0000c61c g     O .bss	00000000 __image_copy_end
  8300004c g     O .bss	00000000 __bss_end
  83000000 g     O .bss	00000000 __bss_start
  83000040 g     O .bss	0000000c stdio_devices

This restores the state of the linker script before the patch that fixed
the linker lists issue.

Fixes: f6810b749f2e ("aspeed/ast2600: Fix SPL linker script")
Signed-off-by: Joel Stanley <joel at jms.id.au>
---
I missed this in testing as I also had "image: fit: Use stack allocation
macro" in my tree. The image now boots without that fix (and with it).

I don't understand why __rel_dyn_start is included in the section name.
I'm removing it to restore what was there before, however the image
boots regardless of it's inclusion.

 arch/arm/mach-aspeed/ast2600/u-boot-spl.lds | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds b/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds
index 95a509ba3f31..37f0ccd92201 100644
--- a/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds
+++ b/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds
@@ -68,7 +68,7 @@ SECTIONS
 
 	_image_binary_end = .;
 
-	.bss __rel_dyn_start (OVERLAY) : {
+	.bss : {
 		__bss_start = .;
 		*(.bss*)
 		 . = ALIGN(4);
-- 
2.35.1



More information about the U-Boot mailing list