]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: fix .data.rel.ro size assertion when CONFIG_LTO_CLANG
authorMasahiro Yamada <masahiroy@kernel.org>
Wed, 6 Nov 2024 16:18:42 +0000 (01:18 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:47:44 +0000 (19:47 +0100)
commit6c772871c2e5dc243ff27d1a4157a63ba4fc4866
tree403fd7add29e7f3850d5e656e9c2ae8c2f3298d6
parentff01ac3e766c4d79ea1498c8427600c5a7520a53
arm64: fix .data.rel.ro size assertion when CONFIG_LTO_CLANG

[ Upstream commit 340fd66c856651d8c1d29f392dd26ad674d2db0e ]

Commit be2881824ae9 ("arm64/build: Assert for unwanted sections")
introduced an assertion to ensure that the .data.rel.ro section does
not exist.

However, this check does not work when CONFIG_LTO_CLANG is enabled,
because .data.rel.ro matches the .data.[0-9a-zA-Z_]* pattern in the
DATA_MAIN macro.

Move the ASSERT() above the RW_DATA() line.

Fixes: be2881824ae9 ("arm64/build: Assert for unwanted sections")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20241106161843.189927-1-masahiroy@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm64/kernel/vmlinux.lds.S