Skip to content

Commit

Permalink
vmlinux.lds.h: Work around Clang issue when targeting PCuABI
Browse files Browse the repository at this point in the history
CHERI/Morello Clang needlessly places data in the RELRO section in
the presence of capabilities. No such section is expected in linker
scripts, causing issues at link-time and/or runtime.

While waiting for Clang to become more conservative about its use of
RELRO data, work around the issue by placing .data.rel.ro together
with .rodata, which is appropriate for the kernel.

CHERI-LLVM issue: CTSRD-CHERI/llvm-project#673

Signed-off-by: Kevin Brodsky <[email protected]>
  • Loading branch information
kevin-brodsky-arm committed Jan 8, 2024
1 parent 4d876ca commit 9e5485f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/asm-generic/vmlinux.lds.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
__start_rodata = .; \
*(.rodata) *(.rodata.*) \
*(.data.rel.ro) \
SCHED_DATA \
RO_AFTER_INIT_DATA /* Read only after init */ \
. = ALIGN(8); \
Expand Down

0 comments on commit 9e5485f

Please sign in to comment.