Skip to content

Fix handling of CO-RE relos for __weak subprogs

Andrii Nakryiko bpf 1 version Applied

Status from this message: This series was applied to bpf/bpf-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyApplied 3/3

Patches in v1 All 3 applied

#Subject and filesSizeRepliesApplied
1/3libbpf: don't error out on CO-RE relos for overriden weak subprogstools/lib/bpf/libbpf.c+11 -40 repliesApplied
2/3libbpf: use weak hidden modifier for USDT BPF-side API functionstools/lib/bpf/usdt.bpf.h+3 -30 repliesApplied
3/3selftests/bpf: add CO-RE relos into linked_funcs selfteststools/testing/selftests/bpf/progs/linked_funcs1.c tools/testing/selftests/bpf/progs/linked_funcs2.c+16 -00 repliesApplied

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH bpf-next 0/3] Fix handling of CO-RE relos for __weak subprogs

Fix the issue accidentally discovered during libbpf USDT support testing. Libbpf overzealously complained about CO-RE relocations belonging to the code of a __weak subprog that got overriden by another instance of that function.

Fix the issue fixed, return back to __weak __hidden annotation for USDT BPF-side APIs.

And add CO-RE relos to linked_funcs selftest to ensure such combo keeps working going forward.

Andrii Nakryiko (3):
libbpf: don't error out on CO-RE relos for overriden weak subprogs
libbpf: use weak hidden modifier for USDT BPF-side API functions selftests/bpf: add CO-RE relos into linked_funcs selftests

 tools/lib/bpf/libbpf.c                            | 15 +++++++++++----
 tools/lib/bpf/usdt.bpf.h                          |  6 +++---
 tools/testing/selftests/bpf/progs/linked_funcs1.c |  8 ++++++++
 tools/testing/selftests/bpf/progs/linked_funcs2.c |  8 ++++++++
 4 files changed, 30 insertions(+), 7 deletions(-)
Signature · 1 line
2.30.2