On Wed, Jan 15, 2020 at 11:08:56AM -0800, Andrii Nakryiko wrote: > The LLVM patch https://reviews.llvm.org/D72197 makes LLVM emit function call > relocations within the same section. This includes a default .text section, > which contains any BPF sub-programs. This wasn't the case before and so libbpf > was able to get a way with slightly simpler handling of subprogram call > relocations. > > This patch adds support for .text section relocations. It needs to ensure > correct order of relocations, so does two passes: > - first, relocate .text instructions, if there are any relocations in it; > - then process all the other programs and copy over patched .text instructions > for all sub-program calls. > > v1->v2: > - break early once .text program is processed. > > Cc: Yonghong Song <yhs@xxxxxx> > Cc: Alexei Starovoitov <ast@xxxxxxxxxx> > Signed-off-by: Andrii Nakryiko <andriin@xxxxxx> Tested with the latest llvm trunk (which points to version 11 already) and all tests pass. Applied. Thanks