summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2026-01-27 15:31:49 -0600
committerTom Rini <[email protected]>2026-01-28 12:57:01 -0600
commit5ffc1dcc26d3df9e2b192151936cb98014fb6e49 (patch)
tree44bff9da0e74b8783d59410fef5463decf44f85b
parent8e263e3a76e353f0e7e559a4c82fcab2e488d8d5 (diff)
arm: Remove rel.dyn from SPL linker scripts
As of v2026.01, no platforms contain any rel.dyn sections in their xPL phase images. Their inclusion in linker scripts initially was an oversight as part of taking the full U-Boot linker scripts and modifying them down. Then in commit 8b0ebe054bb3 ("arm: Update linker scripts to ensure appended device tree is aligned") these sections were used to force correct alignment for the device tree. This however, lead to a different problem. That problem is that when we do not have a separate BSS section in SPL we instead would overlay the BSS with the rel.dyn section, in the common linker script case. This in turn lead to creating an incorrectly sized BSS "pad" file sometimes (depending on arbitrary changes within the rest of the binary itself). This in turn lead to the dtb being in the wrong location in the binary and not found at run time. This commit fixes a few things: - Remove the rel.dyn section from all ARM SPL linker scripts. - In turn, this moves the dtb alignment statement in to another section. - For ast2600 which uses CONFIG_POSITION_INDEPENDENT we need to keep the symbols however. Tested-by: Fabio Estevam <[email protected]> Reported-by: Fabio Estevam <[email protected]> Co-developed-by: Ilias Apalodimas <[email protected]> Reviewed-by: Chia-Wei, Wang <[email protected]> Signed-off-by: Tom Rini <[email protected]>
-rw-r--r--arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds8
-rw-r--r--arch/arm/cpu/u-boot-spl.lds13
-rw-r--r--arch/arm/mach-aspeed/ast2600/u-boot-spl.lds16
-rw-r--r--board/davinci/da8xxevm/u-boot-spl-da850evm.lds9
4 files changed, 11 insertions, 35 deletions
diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
index b4adae272eb..ac166d1d852 100644
--- a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
@@ -33,14 +33,6 @@ SECTIONS
*(.data*)
}
- . = ALIGN(4);
-
- .rel.dyn : {
- __rel_dyn_start = .;
- *(.rel*)
- __rel_dyn_end = .;
- }
-
.bss : {
. = ALIGN(4);
__bss_start = .;
diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
index d780a506077..c578c3ebf82 100644
--- a/arch/arm/cpu/u-boot-spl.lds
+++ b/arch/arm/cpu/u-boot-spl.lds
@@ -41,23 +41,14 @@ SECTIONS
__binman_sym_start = .;
KEEP(*(SORT(.binman_sym*)));
__binman_sym_end = .;
- }
-
- . = ALIGN(4);
-
- __image_copy_end = .;
-
- .rel.dyn : {
- __rel_dyn_start = .;
- *(.rel*)
- __rel_dyn_end = .;
. = ALIGN(8);
}
+ __image_copy_end = .;
_image_binary_end = .;
_end = .;
- .bss __rel_dyn_start (OVERLAY) : {
+ .bss : {
__bss_start = .;
*(.bss*)
. = ALIGN(8);
diff --git a/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds b/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds
index c9664a6ce56..303ace2f61c 100644
--- a/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds
+++ b/arch/arm/mach-aspeed/ast2600/u-boot-spl.lds
@@ -49,19 +49,17 @@ SECTIONS
__binman_sym_start = .;
KEEP(*(SORT(.binman_sym*)));
__binman_sym_end = .;
+ . = ALIGN(8);
} > .nor
- . = ALIGN(4);
+ /*
+ * These platforms enable CONFIG_POSITION_INDEPENDENT and so need
+ * these names. The always however hold the same value.
+ */
+ __rel_dyn_start = .;
+ __rel_dyn_end = .;
__image_copy_end = .;
-
- .rel.dyn : {
- __rel_dyn_start = .;
- *(.rel*)
- __rel_dyn_end = .;
- . = ALIGN(8);
- } > .nor
-
_end = .;
_image_binary_end = .;
diff --git a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
index d1a82e118af..c369c14a255 100644
--- a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
@@ -36,13 +36,8 @@ SECTIONS
.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
. = ALIGN(4);
- __u_boot_list : { KEEP(*(SORT(__u_boot_list*))); } >.sram
-
- . = ALIGN(4);
- .rel.dyn : {
- __rel_dyn_start = .;
- *(.rel*)
- __rel_dyn_end = .;
+ __u_boot_list : {
+ KEEP(*(SORT(__u_boot_list*)));
. = ALIGN(8);
} >.sram