aboutsummaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/exceptions_fail.c
diff options
context:
space:
mode:
authorKumar Kartikeya Dwivedi <memxor@gmail.com>2023-09-13 01:32:12 +0200
committerAlexei Starovoitov <ast@kernel.org>2023-09-16 09:36:43 -0700
commit7e2925f6723702bcfcfdf8f73d5e85f7514d4b9f (patch)
treef4424e5728ae2d88c436a28fe73ea52da23a85ec /tools/testing/selftests/bpf/progs/exceptions_fail.c
parent6c918709bd30852258e66b3f566c9614e3f29e35 (diff)
libbpf: Add support for custom exception callbacks
Add support to libbpf to append exception callbacks when loading a program. The exception callback is found by discovering the declaration tag 'exception_callback:<value>' and finding the callback in the value of the tag. The process is done in two steps. First, for each main program, the bpf_object__sanitize_and_load_btf function finds and marks its corresponding exception callback as defined by the declaration tag on it. Second, bpf_object__reloc_code is modified to append the indicated exception callback at the end of the instruction iteration (since exception callback will never be appended in that loop, as it is not directly referenced). Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com> Link: https://lore.kernel.org/r/20230912233214.1518551-16-memxor@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/exceptions_fail.c')
0 files changed, 0 insertions, 0 deletions