diff --git a/aya/src/bpf.rs b/aya/src/bpf.rs index b812f6f27..8d04e3539 100644 --- a/aya/src/bpf.rs +++ b/aya/src/bpf.rs @@ -375,6 +375,10 @@ impl<'a> EbpfLoader<'a> { /// Loads eBPF bytecode from a buffer. /// + /// The buffer needs to be 4-bytes aligned. If you are bundling the bytecode statically + /// into your binary, it is recommended that you do so using + /// [`include_bytes_aligned`](crate::include_bytes_aligned). + /// /// # Examples /// /// ```no_run @@ -898,6 +902,10 @@ impl Ebpf { /// [maps](crate::maps) defined in it. If the kernel supports [BTF](Btf) /// debug info, it is automatically loaded from `/sys/kernel/btf/vmlinux`. /// + /// The buffer needs to be 4-bytes aligned. If you are bundling the bytecode statically + /// into your binary, it is recommended that you do so using + /// [`include_bytes_aligned`](crate::include_bytes_aligned). + /// /// For more loading options, see [EbpfLoader]. /// /// # Examples