> libbpf: Ignore exception frame section
>
> Exception handling in BPF program is not supported right now, let's skip it.
> BTW, I found this when building BPF with Zig compiler[1].
>
> [1]: https://github.com/tw4452852/bb
>
> Signed-off-by: Tw <[email protected]>
Kumar Kartikeya Dwivedi pointed out in both v1 and v2 reviews that the
Signed-off-by tag must contain the author's full real name, not just
'Tw'. The v2 review explicitly stated: 'You need to have your full real
name in the SoB tag. Patches cannot be accepted otherwise.'
Could you update the Signed-off-by to include your full name?
> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
> index b749c01742ee..05727c418c40 100644
> --- a/tools/lib/bpf/libbpf.c
> +++ b/tools/lib/bpf/libbpf.c
> @@ -3867,7 +3867,8 @@ static Elf64_Rel *elf_rel_by_idx(Elf_Data *data, size_t idx)
> static bool is_sec_name_dwarf(const char *name)
> {
> /* approximation, but the actual list is too long */
> - return str_has_pfx(name, ".debug_");
> + return str_has_pfx(name, ".debug_") ||
> + strcmp(name, ".eh_frame") == 0;
This isn't a bug, but could the continuation line be aligned under the
first operand (tab + 7 spaces) so the two operands line up? Every other
wrapped return statement in libbpf.c uses tab plus seven spaces to align
the continuation, like in bpf_map__is_ringbuf():
return map->def.type == BPF_MAP_TYPE_RINGBUF ||
map->def.type == BPF_MAP_TYPE_USER_RINGBUF;
> }
>
> static bool ignore_elf_section(Elf64_Shdr *hdr, const char *name)
> diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c
> index 78f92c39290a..1fb0efdbfae7 100644
> --- a/tools/lib/bpf/linker.c
> +++ b/tools/lib/bpf/linker.c
> @@ -599,7 +599,8 @@ int bpf_linker__add_buf(struct bpf_linker *linker, void *buf, size_t buf_sz,
> static bool is_dwarf_sec_name(const char *name)
> {
> /* approximation, but the actual list is too long */
> - return strncmp(name, ".debug_", sizeof(".debug_") - 1) == 0;
> + return strncmp(name, ".debug_", sizeof(".debug_") - 1) == 0 ||
> + strcmp(name, ".eh_frame") == 0;
This isn't a bug, but since the same .eh_frame check now has to be
extended in both is_sec_name_dwarf() and is_dwarf_sec_name(), and their
callers ignore_elf_section() and is_ignored_sec() are also near-verbatim
copies including the same .rel prefix-stripping and the same BTF section
exclusions, would it be worth moving the shared predicate into
libbpf_internal.h so future additions only need one edit?
> }
>
> static bool is_ignored_sec(struct src_sec *sec)
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/32731757949
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.