diff options
| author | Tom Rini <[email protected]> | 2026-01-20 10:19:48 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-01-20 12:07:25 -0600 |
| commit | 084faca1d73d2dc3b4081587aee0dd90be5b5346 (patch) | |
| tree | e93167adce7a54d42600405212e2abbdc9d857df /arch/microblaze | |
| parent | 85f586035d75132b2b60d5e593e1c0049f5d126a (diff) | |
| parent | 410d31bae4b863eabd70adb22a0c9976bfe4fee3 (diff) | |
Merge patch series "Update linker scripts to ensure appended device tree is correctly aligned"
Tom Rini <[email protected]> says:
This series builds on top of what Beleswar Padhi did in [1]. While
there's still discussion about the mkimage related parts, the linker
portion appears to the reliable path forward. An alternative that I had
mentioned before, and was part of previous discussions on this topic[2]
is in the end I believe not reliable enough. While we can take an output
file and pad it to where we think it needs to be, ultimately the linker
needs to place the symbol where we want it and if that isn't where we
pad to, we have a different problem. So what this series does (but each
commit message elaborates on the arch-specific linker scripts being
inconsistent) is make sure the linker script will place the required
symbol at 8-byte alignment, and then also use an ASSERT to fail the
build if this would not be true due to some unforseen event.
[1]: https://lore.kernel.org/u-boot/[email protected]/
[2]: https://source.denx.de/u-boot/u-boot/-/issues/30
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'arch/microblaze')
| -rw-r--r-- | arch/microblaze/cpu/u-boot-spl.lds | 5 | ||||
| -rw-r--r-- | arch/microblaze/cpu/u-boot.lds | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/arch/microblaze/cpu/u-boot-spl.lds b/arch/microblaze/cpu/u-boot-spl.lds index 09abbea84d0..620ef2c96db 100644 --- a/arch/microblaze/cpu/u-boot-spl.lds +++ b/arch/microblaze/cpu/u-boot-spl.lds @@ -50,7 +50,7 @@ SECTIONS *(.bss) *(.bss.*) *(COMMON) - . = ALIGN(4); + . = ALIGN(8); __bss_end = .; } _end = . ; @@ -61,3 +61,6 @@ SECTIONS ASSERT(_end - _start <= (CONFIG_SPL_MAX_FOOTPRINT), \ "SPL image plus BSS too big"); #endif + +ASSERT(_image_binary_end % 8 == 0, \ + "_image_binary_end must be 8-byte aligned for device tree"); diff --git a/arch/microblaze/cpu/u-boot.lds b/arch/microblaze/cpu/u-boot.lds index a2c8fb2e21c..70fa49c3171 100644 --- a/arch/microblaze/cpu/u-boot.lds +++ b/arch/microblaze/cpu/u-boot.lds @@ -67,8 +67,10 @@ SECTIONS *(.scommon) *(.bss*) *(COMMON) - . = ALIGN(4); + . = ALIGN(8); __bss_end = .; } _end = . ; } + +ASSERT(_end % 8 == 0, "_end must be 8-byte aligned for device tree"); |
