diff options
| author | Eric Long <[email protected]> | 2024-10-02 06:25:06 +0000 |
|---|---|---|
| committer | Andrii Nakryiko <[email protected]> | 2024-10-08 03:28:53 +0000 |
| commit | 4b146e95da87bf0fe64502aaafebeb622dfff653 (patch) | |
| tree | 5f74161e77ebbea223695504e7a62bdbab29b194 /tools/lib/bpf/linker.c | |
| parent | bpf: syscall_nrs: Disable no previous prototype warnning (diff) | |
| download | kernel-4b146e95da87bf0fe64502aaafebeb622dfff653.tar.gz kernel-4b146e95da87bf0fe64502aaafebeb622dfff653.zip | |
libbpf: Do not resolve size on duplicate FUNCs
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 <[email protected]>
Signed-off-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
Diffstat (limited to 'tools/lib/bpf/linker.c')
| -rw-r--r-- | tools/lib/bpf/linker.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/lib/bpf/linker.c b/tools/lib/bpf/linker.c index 81dbbdd79a7c..f83c1c29982c 100644 --- a/tools/lib/bpf/linker.c +++ b/tools/lib/bpf/linker.c @@ -2451,6 +2451,10 @@ static int linker_append_btf(struct bpf_linker *linker, struct src_obj *obj) if (glob_sym && glob_sym->var_idx >= 0) { __s64 sz; + /* FUNCs don't have size, nothing to update */ + if (btf_is_func(t)) + continue; + dst_var = &dst_sec->sec_vars[glob_sym->var_idx]; /* Because underlying BTF type might have * changed, so might its size have changed, so |
