mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
arm64: fix .data.rel.ro size assertion when CONFIG_LTO_CLANG
[ Upstream commit 340fd66c856651d8c1d29f392dd26ad674d2db0e ] Commitbe2881824a("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:be2881824a("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a8627dde40
commit
bae56996ff
@@ -272,6 +272,9 @@ SECTIONS
|
|||||||
__initdata_end = .;
|
__initdata_end = .;
|
||||||
__init_end = .;
|
__init_end = .;
|
||||||
|
|
||||||
|
.data.rel.ro : { *(.data.rel.ro) }
|
||||||
|
ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!")
|
||||||
|
|
||||||
_data = .;
|
_data = .;
|
||||||
_sdata = .;
|
_sdata = .;
|
||||||
RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN)
|
RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN)
|
||||||
@@ -323,9 +326,6 @@ SECTIONS
|
|||||||
*(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
|
*(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
|
||||||
}
|
}
|
||||||
ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
|
ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
|
||||||
|
|
||||||
.data.rel.ro : { *(.data.rel.ro) }
|
|
||||||
ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "image-vars.h"
|
#include "image-vars.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user