This is an archive of the discontinued LLVM Phabricator instance.

[RuntimeDyld][BPF] load additional sections
AbandonedPublic

Authored by yonghong-song on Jan 15 2019, 9:25 AM.

Details

Reviewers
lhames
Summary

With target bpf and -g, current clang/llvm compiler generates
two sections, .BTF and .BTF.ext, for BPF debugging.
The .BTF does not have any symbols, and does not have any
relocations either. Hence, even with ProcessAllSections
enabled, it is not loaded by runtime dynamic linker.

This patch extended RuntimeDyldELF with a BPF subclass.
The RuntimeDyldELFBPF overrided finalizeLoad() such that
first loads .BTF section if it exists and then proceeds
with the rest finalizeLoad() operation.

Signed-off-by: Yonghong Song <yhs@fb.com>

Diff Detail

Repository
rL LLVM

Event Timeline

yonghong-song created this revision.Jan 15 2019, 9:25 AM
yonghong-song added a comment.EditedJan 15 2019, 9:30 AM

Hi, @lhames this is an alternative implementation w.r.t. D55943. In D55943, if ProcessAllSections is set to true, all sections will be loaded.
I am not sure whether this is the original intention of not as it says ProcessAllSections, not meaning LoadAllSections.

So this patch extends RuntimeDyldELF for BPF target. It will load .BTF section, which is what we want in the bcc or other JIT implementations.

Could you let me know which method you prefer? I think this patch is better. Thanks!

yonghong-song abandoned this revision.Jan 15 2019, 4:45 PM

Abandon this patch. D55943 is the recommended approach.