From: Yonghong Song <yonghong.song@linux.dev>
To: Eduard Zingerman <eddyz87@gmail.com>, bpf@vger.kernel.org
Cc: Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
kernel-team@fb.com, Martin KaFai Lau <martin.lau@kernel.org>
Subject: Re: [PATCH bpf-next] libbpf: Silence newly-added and unused sections
Date: Sat, 20 Sep 2025 18:41:50 -0700 [thread overview]
Message-ID: <22db8dd3-5df4-401d-8d63-5e0f2294bfd3@linux.dev> (raw)
In-Reply-To: <bb7aca1aa66dc0791cbdb16934b4b4a139a63695.camel@gmail.com>
On 9/20/25 5:30 PM, Eduard Zingerman wrote:
> On Sat, 2025-09-20 at 08:35 -0700, Yonghong Song wrote:
>> With latest llvm22, when building bpf selftest, I got the following info
>> emitted by libbpf:
>> ...
>> libbpf: elf: skipping unrecognized data section(14) .comment
>> libbpf: elf: skipping section(15) .note.GNU-stack (size 0)
>> ...
>>
>> The reason is due to llvm patch [1]. Previously, bpf class BPFMCAsmInfo
>> inherits class MCAsmInfo. With [1], BPFMCAsmInfo inherits class
>> MCAsmInfoELF. Such a change added two more sections in the bpf binary, e.g.
>> [Nr] Name Type Address Off Size ES Flg Lk Inf Al
>> ...
>> [23] .comment PROGBITS 0000000000000000 0035ac 00006d 01 MS 0 0 1
> This section is generated by MCELFStreamer::emitIdent(), virtual
> function.
>
>> [24] .note.GNU-stack PROGBITS 0000000000000000 003619 000000 00 0 0 1
> And this one is generated by MCELFStreamer::initSections() virtual
> function and is controlled by NoExecStack formal parameter.
>
> MCELFStreamer instance for BPF backend is created by function
> BPFMCTargetDesc.cpp:createBPFMCStreamer().
>
> I think we can define a sub-class BPFMCELFStreamer, override the above
> virtual functions and suppress generation of the sections above.
>
> [...]
Two llvm pull request:
to avoid generating .comment section:
https://github.com/llvm/llvm-project/pull/159958
to avoid generating .note.GNU-stack section:
https://github.com/llvm/llvm-project/pull/159960
next prev parent reply other threads:[~2025-09-21 1:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-20 15:35 [PATCH bpf-next] libbpf: Silence newly-added and unused sections Yonghong Song
2025-09-20 15:56 ` Alexei Starovoitov
2025-09-20 16:18 ` Yonghong Song
2025-09-20 18:50 ` Yonghong Song
2025-09-20 22:41 ` Alexei Starovoitov
2025-09-21 0:30 ` Eduard Zingerman
2025-09-21 1:41 ` Yonghong Song [this message]
2025-09-21 4:01 ` Eduard Zingerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22db8dd3-5df4-401d-8d63-5e0f2294bfd3@linux.dev \
--to=yonghong.song@linux.dev \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=kernel-team@fb.com \
--cc=martin.lau@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.