Re: [RFC PATCH v4 07/29] bpf tools: Check endianess and make libbpf fail early

From: Alexei Starovoitov
Date: Wed May 27 2015 - 21:45:21 EST


On Wed, May 27, 2015 at 05:19:42AM +0000, Wang Nan wrote:
> Check endianess according to EHDR. Code is taken from
> tools/perf/util/symbol-elf.c.
>
> Libbpf doesn't magically convert missmatched endianess. See discussion
> on https://lkml.org/lkml/2015/5/18/650 that, even if we swap
> eBPF instructions to correct byte order, we are unable to deal with
> endianess in code logical generated by LLVM.
>
> Therefore, libbpf should simply reject missmatched ELF object, and let
> LLVM to create good code.
>
> Signed-off-by: Wang Nan <wangnan0@xxxxxxxxxx>

lgtm
Acked-by: Alexei Starovoitov <ast@xxxxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/