Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BPF static linker: fix failure when encountering duplicate extern functions #7792

Open
wants to merge 2 commits into
base: bpf-next_base
Choose a base branch
from

Conversation

kernel-patches-daemon-bpf[bot]
Copy link

Pull request for series with
subject: BPF static linker: fix failure when encountering duplicate extern functions
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=893710

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 93eeaab
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=893710
version: 1

@kernel-patches-daemon-bpf
Copy link
Author

Upstream branch: 93eeaab
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=893727
version: 2

FUNCs do not have sizes, thus currently btf__resolve_size will fail
with -EINVAL. Add conditions so that we only update size when the BTF
object is not function or function prototype.

Signed-off-by: Eric Long <i@hack3r.moe>
…ons doesn't fail

Previously when multiple BPF object files referencing the same extern
function (usually kfunc) are statically linked using `bpftool gen
object`, libbpf tries to get the nonexistent size of BTF_KIND_FUNC_PROTO
and fails. This test ensures it is fixed.

Signed-off-by: Eric Long <i@hack3r.moe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant