aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorAndrii Nakryiko <andriin@fb.com>2019-11-20 23:07:41 -0800
committerAlexei Starovoitov <ast@kernel.org>2019-11-24 16:58:45 -0800
commit1f8e2bcb2cd5ee1a731fb625a5438e2c305f6a7c (patch)
treeb06cb9fbde1c9a91db7429122fef164adfc10ac6 /block
parentselftests/bpf: Ensure no DWARF relocations for BPF object files (diff)
downloadlinux-dev-1f8e2bcb2cd5ee1a731fb625a5438e2c305f6a7c.tar.xz
linux-dev-1f8e2bcb2cd5ee1a731fb625a5438e2c305f6a7c.zip
libbpf: Refactor relocation handling
Relocation handling code is convoluted and unnecessarily deeply nested. Split out per-relocation logic into separate function. Also refactor the logic to be more a sequence of per-relocation type checks and processing steps, making it simpler to follow control flow. This makes it easier to further extends it to new kinds of relocations (e.g., support for extern variables). This patch also makes relocation's section verification more robust. Previously relocations against not yet supported externs were silently ignored because of obj->efile.text_shndx was zero, when all BPF programs had custom section names and there was no .text section. Also, invalid LDIMM64 relocations against non-map sections were passed through, if they were pointing to a .text section (or 0, which is invalid section). All these bugs are fixed within this refactoring and checks are made more appropriate for each type of relocation. Signed-off-by: Andrii Nakryiko <andriin@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Link: https://lore.kernel.org/bpf/20191121070743.1309473-3-andriin@fb.com
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions