Re: [External] Re: [External] Re: GCC jump tables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2023-08-08 16:48, Segher Boessenkool wrote:
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://urldefense.proofpoint.com/v2/url?u=https-3A__elixir.bootlin.com_linux_v5.15_source_mm_gup.c-23L1964&d=DwIDAw&c=aC52l5ychvsxSLm72twIgEW2BEeqYPY0uTQnrVZ6RBM&r=MPhNfvPJjusxPWFiIwhytlSBR8Vj8O1RcqwrEfh5BQ7jv0n8sh4iBBnJso-aIHAA&m=-_eY5Xylio3iSKZ0qoybyl-kdPuN3EDl1o7eQhcMEzkzScMNML1FGQrPEelgvGhT&s=prTAoPR06auK9EH2ixHIy5SdiVRW5y3jXXsjhaFdKgs&e=

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.


Yep, already found the needed flag to #undef to disable jump tables emission - https://elixir.bootlin.com/linux/v5.15/source/arch/Kconfig#L48

Andrey




Segher


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux