Re: [PATCH bpf] libbpf: fix CO-RE relocs against .text section

2020-06-23 Thread Yonghong Song
On 6/23/20 5:40 PM, Alexei Starovoitov wrote: On Sat, Jun 20, 2020 at 12:06 AM Yonghong Song wrote: On 6/19/20 4:04 PM, Andrii Nakryiko wrote: bpf_object__find_program_by_title(), used by CO-RE relocation code, doesn't return .text "BPF program", if it is a function storage for sub-progr

Re: [PATCH bpf] libbpf: fix CO-RE relocs against .text section

2020-06-23 Thread Alexei Starovoitov
On Sat, Jun 20, 2020 at 12:06 AM Yonghong Song wrote: > > > > On 6/19/20 4:04 PM, Andrii Nakryiko wrote: > > bpf_object__find_program_by_title(), used by CO-RE relocation code, doesn't > > return .text "BPF program", if it is a function storage for sub-programs. > > Because of that, any CO-RE relo

Re: [PATCH bpf] libbpf: fix CO-RE relocs against .text section

2020-06-20 Thread Yonghong Song
On 6/19/20 4:04 PM, Andrii Nakryiko wrote: bpf_object__find_program_by_title(), used by CO-RE relocation code, doesn't return .text "BPF program", if it is a function storage for sub-programs. Because of that, any CO-RE relocation in helper non-inlined functions will fail. Fix this by searchin

[PATCH bpf] libbpf: fix CO-RE relocs against .text section

2020-06-19 Thread Andrii Nakryiko
bpf_object__find_program_by_title(), used by CO-RE relocation code, doesn't return .text "BPF program", if it is a function storage for sub-programs. Because of that, any CO-RE relocation in helper non-inlined functions will fail. Fix this by searching for .text-corresponding BPF program manually.