Re: [PATCH] compiler.h: Specify correct attribute for .rodata..c_jump_table
From: Josh Poimboeuf
Date: Thu Feb 13 2025 - 13:54:18 EST
On Thu, Feb 13, 2025 at 08:38:22PM +0800, Tiezhu Yang wrote:
> Based on the above analysis, in order to avoid changing the behavior of
> GNU assembler and silence the GNU assembler warning, is it possible to
> rename ".rodata..c_jump_table" to ".c_jump_table"?
Yeah, though for the final vmlinux link we'd still need it to end up in
.rodata so it remains read-only at runtime.
So we'd basically just have to add it to the RO_DATA() macro in
include/asm-generic/vmlinux.lds.h.
Does it still work if we call it ..rodata.c_jump_table or so? Then we
could just add "*(..rodata.*) to RO_DATA(). That would be somewhat less
surprising, and would also create a standard way for other code to do
the same thing by prefixing with "..rodata.".
--
Josh