arm64: Properly clear BSS
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 2 Sep 2025 06:08:12 +0000 (09:08 +0300)
committerTom Rini <trini@konsulko.com>
Tue, 9 Sep 2025 18:43:26 +0000 (12:43 -0600)
commit5d01a971804e3f7f7d320870acf5418bd8497535
treef1e36f348d67212def82837d767ebd90faa3d4c0
parenta5b483a52a5561030ab3e50923a215fbed49d006
arm64: Properly clear BSS

Brock reports a breakage on an RK3568 SoC. His patch is
correct but he never followed up on the requested changes.

We currently use ldr to calculate the address of __bss_start and
__bss_end. However the absolute addresses of the literal pool are never
relocated and we end up clearing the wrong memory section. Use
PC-relative addressing instead.

Link: https://lore.kernel.org/u-boot/zfknlzcemnnaka5w2er5wjwefwoidrpndc4gjhx6d5xr6nlcjr@pasfayjiutii/
Suggested-by: brock_zheng <yzheng@techyauld.com>
Reported-by: brock_zheng <yzheng@techyauld.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
arch/arm/lib/crt0_64.S