kmodloader: Check module endian before loading
If we manage to accidentally get a module installed that does not match
the system endianess (there is currently nothing preventing that in
OpenWrt/LEDE) we will hit a segmentation fault when doing this:
sh = (Elf32_Shdr *) (map + e->e_shoff);
because e->e_shoff will be wrongly encoded and this most likely will
result in an invalid offset to de-reference from.
Update elf_find_section() to check that the build time endianess of
kmodloader matches that of the module, otherwise nothing would work
really.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>