[RFC PATCH v2 08/30] vmlinux.lds.h: Allow architectures to emit custom RO_DATA sections

From: Ian Rogers

Date: Wed Nov 25 2026 - 01:18:21 EST


Add an optional ARCH_RODATA_SECTIONS hook inside RO_DATA() so
architectures using runtime .eh_frame / .eh_frame_hdr kernel unwinding
can place unwind tables inside write-protected RO_DATA without leaving
them in unmapped rodata/data gap pages.

Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
include/asm-generic/vmlinux.lds.h | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 3eb732942d69..1bde7a2a19d0 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -472,6 +472,10 @@
#endif
#endif

+#ifndef ARCH_RODATA_SECTIONS
+#define ARCH_RODATA_SECTIONS
+#endif
+
/*
* Read only Data
*/
@@ -554,6 +558,7 @@
RO_EXCEPTION_TABLE \
NOTES \
BTF \
+ ARCH_RODATA_SECTIONS \
\
. = ALIGN((align)); \
__end_rodata = .;
--
2.56.1.831.g720f3f5937-goog