Subject: Re: [PATCH bpf-next] libbpf: ignore .eh_frame sections when parsing elf files

From: Toke Høiland-Jørgensen <[email-masked]>
Date: Mon, 05 Jul 2021 12:33:09 +0200

Daniel Borkmann <[email-masked]> writes:

> On 6/29/21 1:09 PM, Toke Høiland-Jørgensen wrote:
>> The .eh_frame and .rel.eh_frame sections will be present in BPF object
>> files when compiled using a multi-stage compile pipe like in samples/bpf.
>> This produces errors when loading such a file with libbpf. While the errors
>> are technically harmless, they look odd and confuse users. So add .eh_frame
>> sections to is_sec_name_dwarf() so they will also be ignored by libbpf
>> processing. This gets rid of output like this from samples/bpf:
>> 
>> libbpf: elf: skipping unrecognized data section(32) .eh_frame
>> libbpf: elf: skipping relo section(33) .rel.eh_frame for section(32) .eh_frame
>> 
>> Signed-off-by: Toke Høiland-Jørgensen <[email-masked]>
>
> For the samples/bpf case, could we instead just add a -fno-asynchronous-unwind-tables
> to clang as cflags to avoid .eh_frame generation in the first place?

Ah, great suggestion! Was trying, but failed, to figure out how to do
that. Just tested it, and yeah, that does fix samples; will send a
separate patch to add that.

I still think filtering this section name in libbpf is worthwhile,
though, as the error message is really just noise... WDYT?

-Toke