[yocto] RPi app built with SDK won't load
Paul D. DeRocco
pderocco at ix.netcom.com
Wed Jul 5 23:19:13 PDT 2017
I incorporated all the relevant symbols from environment-setup-cortexa7hf-neon-vfpv4-poky-linux-gnueabi. I defined the compilation command as ${CC} ${CFLAGS} and the linker command as ${LD} ${LDFLAGS}. Other Eclipse settings added -O3 -Wall -c to the compile, and -s to the link.
When I did the build, the compile succeeded, but the link complained about "-Wl,-O1" as an unrecognized option. I first tried eliminating the "-Wl," prefixes, but that gave me a "cannot find entry symbol _start" error. I put the "-Wl," prefixes back, but changed the link command from arm-poky-linux-gnueabi-ld to arm-poky-linux-gnueabi-gcc, and it linked okay, but gave me the same runtime error I've been struggling with.
However, Lukasz put his finger on the problem when he wrote
> From: Lukasz Tekieli [mailto:tekieli.lukasz at gmail.com]
>
> it seems that if linker is called without -mfloat-abi=hard
> then the ld is set to /lib/ld-linux.so.3 instead of
> /lib/ld-linux-armhf.so.3 which is the correct one.
It turns out the correct way to run the linker is $CC $CFLAGS $LDFLAGS, not $LD $LDFLAGS.
The reason this escaped me for all this time is that I was using arm-poky-linux-gnueabi-objdump -x on the executable, and grepping for NEEDED to find out what shared libraries were needed. The actual loader isn't listed in this way. Using the -s option showed that the .interp section contained the string /lib/ld-linux.so.3. Now it correctly shows /lib/ld-linux-armhf.so.3.
Thanks to all who looked into this for me.
--
Ciao, Paul D. DeRocco
Paul mailto:pderocco at ix.netcom.com
More information about the yocto
mailing list