Skip to content

Commit 340fd66

Browse files
masahir0yctmarinas
authored andcommitted
arm64: fix .data.rel.ro size assertion when CONFIG_LTO_CLANG
Commit be28818 ("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: be28818 ("arm64/build: Assert for unwanted sections") Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent dc9b74a commit 340fd66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/arm64/kernel/vmlinux.lds.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,9 @@ SECTIONS
287287
__initdata_end = .;
288288
__init_end = .;
289289

290+
.data.rel.ro : { *(.data.rel.ro) }
291+
ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!")
292+
290293
_data = .;
291294
_sdata = .;
292295
RW_DATA(L1_CACHE_BYTES, PAGE_SIZE, THREAD_ALIGN)
@@ -343,9 +346,6 @@ SECTIONS
343346
*(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
344347
}
345348
ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
346-
347-
.data.rel.ro : { *(.data.rel.ro) }
348-
ASSERT(SIZEOF(.data.rel.ro) == 0, "Unexpected RELRO detected!")
349349
}
350350

351351
#include "image-vars.h"

0 commit comments

Comments
 (0)