UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Reply

Petalinux 2015.2 Invalid ELF file .../vmlinux

Accepted Solution Solved
Visitor
Posts: 13
Registered: ‎11-13-2014
Accepted Solution

Petalinux 2015.2 Invalid ELF file .../vmlinux

Hello,

 

I get the following error while building petalinux from Xilinx-ZC702-v2015.2.1-final.bsp:

 

[ERROR] ERROR: Invalid ELF file '/opt/petalinux/Xilinx-ZC702-2015.2/images/linux/vmlinux'
ERROR: Failed to build linux

 

I'm running on a VM with Ubuntu 14 LTS.

 

I have worked through several posts regarding this failure and could not find any solution. Haw can I debug this failure?


Accepted Solutions
Visitor
Posts: 13
Registered: ‎11-13-2014

Re: Petalinux 2015.2 Invalid ELF file .../vmlinux

Hi linnj,

 

finally I maked a clean Ubuntu install and followed this instructions:

 

http://embeddedcentric.com/embedded-operating-systems/

 

installing this packeges:

 

sudo apt-get install tofrodos iproute tftpd-hpa gawk gcc git-core make net-tools libncurses5-dev zlib1g-dev libssl-dev flex bison lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 libselinux1

 

It works now. It's a pitty that I could find out the root cause. I'm sure it was a package dependency. I would wish to see that the petalinux installer displyes some information about wrong dependencies in future.

 

Thanks!

View solution in original post


All Replies
Highlighted
Scholar
Posts: 1,533
Registered: ‎09-10-2008

Re: Petalinux 2015.2 Invalid ELF file .../vmlinux

Have you verified the elf is good using objdump?

It looks like petalinux-gen-fitimage is the issue, but I'm not confident.
Visitor
Posts: 13
Registered: ‎11-13-2014

Re: Petalinux 2015.2 Invalid ELF file .../vmlinux

I have checked the elf files with "file" utility and they where all 32bit, little endian. Seems to be correct.

vmlinux itself is not a elf file but I will try it with objdump as you proposed. I will post the result on monday.

 

By the way, I couldn't find any binary like petalinux-gen-fitimage, I thought this will call mkimage to combine kernel, device tree and rootfs and put a u-boot header on it. Is this right?

Scholar
Posts: 1,533
Registered: ‎09-10-2008

Re: Petalinux 2015.2 Invalid ELF file .../vmlinux

I find it in the Petalinux install at

petalinux-v2015.2.1-final/tools/common/petalinux/utils/petalinux-gen-fitimage
Visitor
Posts: 13
Registered: ‎11-13-2014

Re: Petalinux 2015.2 Invalid ELF file .../vmlinux

Hi linnj,

 

finally I maked a clean Ubuntu install and followed this instructions:

 

http://embeddedcentric.com/embedded-operating-systems/

 

installing this packeges:

 

sudo apt-get install tofrodos iproute tftpd-hpa gawk gcc git-core make net-tools libncurses5-dev zlib1g-dev libssl-dev flex bison lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6 libselinux1

 

It works now. It's a pitty that I could find out the root cause. I'm sure it was a package dependency. I would wish to see that the petalinux installer displyes some information about wrong dependencies in future.

 

Thanks!

Visitor hs2
Visitor
Posts: 6
Registered: ‎07-21-2015

Re: Petalinux 2015.2 Invalid ELF file .../vmlinux

@herrmannxilinx: Basically it's all about missing host system libs required by petalinux tools as you found out yourself. This thread is also related to this issue.

The installer should be better when checking dependencies ;)

HS2

Newbie
Posts: 1
Registered: ‎10-18-2015

Re: Petalinux 2015.2 Invalid ELF file .../vmlinux

I am still worried about by the same error, even though I followed the instructions:
http://embeddedcentric.com/embedded-operating-systems/

I thinck the cause is that I cannot get lib32bz2-1.0.
I failed "apt-get install lib32bz2-1.0". Several servers rejected this access.
Are their any server which provide this package directly ?

The Site
http://askubuntu.com/questions/637113/unable-to-locate-package-lib32bz2-1-0
suggested "The package (32 bit) you are looking for is libbz2-1.0:i386, its 64 bit version is libbz2-1.0:amd64."
So,I tried:
sudo dpkg --add-architecture i386
sudo apt-get update.
sudo apt-get install libbz2-1.0:i386.

But it still doesn't work.
Complex packages install and remove prosess may cuase this situation.

Newbie
Posts: 1
Registered: ‎06-25-2016

Re: Petalinux 2015.2 Invalid ELF file .../vmlinux

There is another cause of this problem: locale.

 

long story short:

LANG=C LC_LANG=C petalinux-build

 

details:

petalinux-build parses the output of readelf to check generated kernel format.

If your locale differs from US the readelf output does not match the parser rules, which threat this as an invalid kernel.

 

For Xilinx developers:

A good solution to the problem is using libelf to parse the kernel, or libmagic, which provide some some good info about ELFs.

 

Have a good night :P

 

 

 

( tested with petalinux 2016.2 )

Newbie
Posts: 1
Registered: ‎01-10-2017

Re: Petalinux 2015.2 Invalid ELF file .../vmlinux

I solve my problem with petalinux-build :

ERROR: Invalid ELF file .../vmlinux

 

 

by changing the language from german to US-english:

"en_US"

 

$ locale

 

LANG=en_US.UTF-8

LANGUAGE=en_US:en_GB:en

LC_CTYPE="en_US.UTF-8"

 

...