-
- Downloads
bpf: support `naked' function attributes in BPF targets
The kernel selftests and other BPF programs make extensive use of the `naked' function attribute with bodies written using basic inline assembly. This patch adds support for the attribute to bpf-unkonwn-none, makes it to inhibit warnings due to lack of explicit `return' statement, and updates documentation and testsuite accordingly. Tested in x86_64-linux-gnu host and bpf-unknown-none target. gcc/ChangeLog PR target/111046 * config/bpf/bpf.cc (bpf_attribute_table): Add entry for the `naked' function attribute. (bpf_warn_func_return): New function. (TARGET_WARN_FUNC_RETURN): Define. (bpf_expand_prologue): Add preventive comment. (bpf_expand_epilogue): Likewise. * doc/extend.texi (BPF Function Attributes): Document the `naked' function attribute. gcc/testsuite/ChangeLog * gcc.target/bpf/naked-1.c: New test.
Loading
Please register or sign in to comment