On Tue, Aug 08, 2023 at 11:14:02AM -0400, Andrey Grodzovsky wrote: > On 2023-08-08 10:54, Segher Boessenkool wrote: > >On Mon, Aug 07, 2023 at 10:59:51PM -0400, Andrey Grodzovsky via Gcc-help > >wrote: > >>Hello, question regarding jump tables - is there a way to totally > >>disable their generation in C code ? I know -fno-jump-tables but it's > >>only effective for switch cases, but still after compiling my code with > >>this flag i see a jump table being generated due to some function call. > >>Is there any way to totally prevent their creation ? > >For what other source code do you see jump tables generated? > > It's calling any of the get_user_pages_remote, get_user_pages, put_page, > mmap_read_lock, mmap_read_unlock function calls, > I am calling them from within kernel module, they reside in the > monolitic vmlinux kernel binary and are exported outside > for kernel modules use. e.g. Definition of get_user_pages is here > https://elixir.bootlin.com/linux/v5.15/source/mm/gup.c#L1964 > > >Or, let's > >take a step back first: what exactly do you call a "jump table" here? > > For me it would be anything that ends up creating a jump table entry in > the ELF header or the resulting object file so this when This is stuff that the Linux kernel does. Manually. The compiler has nothing to do with it. Segher