Skip to content
Commit 23671f4d authored by Ian Rogers's avatar Ian Rogers Committed by Andrii Nakryiko
Browse files

bpftool: Align output skeleton ELF code



libbpf accesses the ELF data requiring at least 8 byte alignment,
however, the data is generated into a C string that doesn't guarantee
alignment. Fix this by assigning to an aligned char array. Use sizeof
on the array, less one for the \0 terminator, rather than generating a
constant.

Fixes: a6cc6b34 ("bpftool: Provide a helper method for accessing skeleton's embedded ELF data")
Signed-off-by: default avatarIan Rogers <irogers@google.com>
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Reviewed-by: default avatarAlan Maguire <alan.maguire@oracle.com>
Acked-by: default avatarQuentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/20231007044439.25171-1-irogers@google.com
parent 0d7ae068
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment