[Buildroot] Using buildroot to compile Xilinx Kernel - ELF file error

Arnout Vandecappelle arnout at mind.be
Tue Dec 18 00:15:32 UTC 2018

On 15/12/2018 22:46, Gaston Melo wrote:
> hi to all
> im really new on embedded world and I build a kernel using buildroot
> Im using the xilinx kernel (downloaded from github xilinx repository) and
> already make configs. I have the dts file generated by device-tree on ISE 14.7
> I can build the kernel using buildroot but my problem is when I tried to
> download the elf file to the spartan 6.
> it says "readelf: Error: Not an ELF file - it has the wrong magic bytes at the
> start"

 What you say here doesn't make a lot of sense... The kernel is typically not an
ELF file (well, the vmlinux image is but that's not what you normally use), and
on the target system you typically don't have a readelf executable... So what
exactly are you doing here?

> I tried to find the cause of this error on the Net but no luck so far. IM using
> this as references:
> https://github.com/numato/samplecode/blob/master/FPGA/galatea/galateaLinux-BSP/numato_galatea_defconfig
> https://github.com/numato/samplecode/blob/master/FPGA/galatea/galateaLinux-BSP/galatea_defconfig#L4
> The differences are Im using big endian

 That could explain the "wrong magic bytes" thing. Maybe you're trying to use
your little-endian host readelf to check the target executable? That's not going
to work, you need the cross-readelf (output/host/bin/*-readelf).


More information about the buildroot mailing list