diff options
| author | Marek Vasut <[email protected]> | 2025-11-16 01:14:32 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-11-28 10:20:31 -0600 |
| commit | 8c0d78ddc4989fe95337b20e392a76e796001eb6 (patch) | |
| tree | 6a0d6bfb32ae6369193add174fe0ca84234e365c | |
| parent | f74353099016a22500830adda2bb0558322b414c (diff) | |
xtensa: Assure end of U-Boot is at 8-byte aligned offset
Make sure the end of U-Boot is at 8-byte aligned offset, not 4-byte
aligned offset. This allows safely appending DT at the end of U-Boot
with the guarantee that the DT will be at 8-byte aligned offset. This
8-byte alignment is now checked by newer libfdt 1.7.2 .
Signed-off-by: Marek Vasut <[email protected]>
| -rw-r--r-- | arch/xtensa/cpu/u-boot.lds | 2 | ||||
| -rw-r--r-- | arch/xtensa/include/asm/ldscript.h | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/arch/xtensa/cpu/u-boot.lds b/arch/xtensa/cpu/u-boot.lds index 72e4b9a706e..6894d4c327b 100644 --- a/arch/xtensa/cpu/u-boot.lds +++ b/arch/xtensa/cpu/u-boot.lds @@ -78,7 +78,7 @@ SECTIONS SECTION_text(XTENSA_SYS_TEXT_ADDR, FOLLOWING(.DoubleExceptionVector.text)) SECTION_rodata(ALIGN(16), FOLLOWING(.text)) SECTION_u_boot_list(ALIGN(16), FOLLOWING(.rodata)) - SECTION_data(ALIGN(16), FOLLOWING(__u_boot_list)) + SECTION_data(ALIGN(16), FOLLOWINGDT(__u_boot_list)) __reloc_end = .; __init_end = .; diff --git a/arch/xtensa/include/asm/ldscript.h b/arch/xtensa/include/asm/ldscript.h index bcf0fd5a744..50d3b390405 100644 --- a/arch/xtensa/include/asm/ldscript.h +++ b/arch/xtensa/include/asm/ldscript.h @@ -21,6 +21,9 @@ #define FORCE_OUTPUT . = . #define FOLLOWING(sec) \ AT(((LOADADDR(sec) + SIZEOF(sec) + ALIGN_LMA-1)) & ~(ALIGN_LMA-1)) +#define ALIGN_LMA_DT 8 +#define FOLLOWINGDT(sec) \ + AT(((LOADADDR(sec) + SIZEOF(sec) + ALIGN_LMA_DT-1)) & ~(ALIGN_LMA_DT-1)) /* * Specify an output section that will be added to the ROM store table @@ -110,6 +113,7 @@ ___u_boot_list_start = ABSOLUTE(.); \ KEEP(*(SORT(__u_boot_list*))); \ ___u_boot_list_end = ABSOLUTE(.); \ + . = ALIGN(ALIGN_LMA_DT); \ } #define SECTION_data(_vma_, _lma_) \ @@ -130,6 +134,7 @@ *(.eh_frame) \ *(.dynamic) \ *(.gnu.version_d) \ + . = ALIGN(ALIGN_LMA_DT); \ _data_end = ABSOLUTE(.); \ } |
