]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
xtensa: Correct define of _end symbol
authorJiaxun Yang <jiaxun.yang@flygoat.com>
Tue, 18 Jun 2024 13:56:02 +0000 (14:56 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 4 Jul 2024 22:08:37 +0000 (16:08 -0600)
So U-Boot is using _end symbol to detect location of devicetree
appended at the end of the ROM.

It needs to be calculated based on end of .data load address,
as in our lds .current address is address in RAM.

Tested-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
arch/xtensa/cpu/u-boot.lds
arch/xtensa/include/asm/ldscript.h

index 84ba32c0444403132ca663f3d4a1c644555c8e2f..72e4b9a706e59623aa2fc171ed40282b068ac2e9 100644 (file)
@@ -82,6 +82,8 @@ SECTIONS
 
   __reloc_end = .;
   __init_end = .;
+  /* Calculation to get end address in ROM */
+  _end = LOADADDR(.data) + (_data_end - _data_start);
 
   SECTION_bss(__init_end (OVERLAY),)
 
index 78a0b230bdaaba24ec9f1ef9dbeee72a1c20e746..bcf0fd5a7443b8b73c16e1310ea3d1f5bc21e81e 100644 (file)
                . = ALIGN(8);                                           \
                _bss_end = ABSOLUTE(.);                                 \
                __bss_end = ABSOLUTE(.);                                \
-               _end = ALIGN(0x8);                                      \
                PROVIDE(end = ALIGN(0x8));                              \
                _stack_sentry = ALIGN(0x8);                             \
        }