Re: Cannot run simple binary executable file

Wy kevinthesun <kevinthesunwy@...>

However, a new problem occurs. Now when I tries run HelloWorld binary, after "Hello World" is printed, the terminal also prints "Segmentation fault". It seems that some memory problems occurs. I guess it comes from that the 1.5.1 yocto system on boards hopes as dynamic linker, instead of, which is used by toolchain. There may be some memory address problem between them. How can I solve it?

Thank you!

2014-10-07 18:17 GMT-07:00 Wy kevinthesun <kevinthesunwy@...>:

Problem solved! It turns out it is the mismatch of I referred to this post, and found my problem was exactly the same: the binary needs /lib/ to run, but that file is missing in the 1.5.1 yocto system on board. Then I copied file from Yocto toolchain on my pc. Then it works!

Thank you!

2014-10-07 8:21 GMT-07:00 Nicolas Dechesne <nicolas.dechesne@...>:

On Tue, Oct 7, 2014 at 1:07 PM, Wy kevinthesun <kevinthesunwy@...> wrote:
> Hi, I am new to Yocto Project and learning to develop software on Atmel
> SAMA5D3 Xplained board, on which Yocto 1.5.1 is pre-built. I followed the
> instructions and got the 1.6.1 toolchain
> I can compile the simple HelloWorld program and binary file is made. Then I
> copied the binary file
> into board and tried to run it. However, when I changed to the file located
> directory and type
> "./Hello", it returned "sh: ./Hello: No such file or directory". Then I
> tried "sh Hello", it gave
> me  "Hello: Hello: cannot execute binary file ". If I type "file Hello", it
> gives "Hello: ELF 32-bit
>  LSB  executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses
> shared libs), for GNU/Linux 2.6.16,
> BuildID[sha1]=9933a2d2ce212099c5f9902a8e612c1423e136da, not stripped". I
> googled and someone
> said the problem may be the toolchain. Then I tried 1.3, 1.5.1 toolchain for
> arm, but still same
> error. Could you please help me about this problem?

i suspect this is an armv7 soft-float vs hard-float mismatch. Either
your prebuilt OE system is configured with soft-float and the
toolchain you use compiled for hard-float by default, or the other way
around. can you check how you've compile HelloWolrd and check the
other ABI?

Join to automatically receive all group messages.