[yocto] [prelink-cross] error while loading shared libraries: ld-linux.so.3

Mark Hatle mark.hatle at windriver.com
Tue Jun 16 12:12:07 PDT 2015


On 6/16/15 2:01 AM, Florian Boehmak wrote:
> Hi,
> 
> I am having difficulties to cross-prelink a simple hello world program.
> Prelinking for my x86 machine works fine (host system) but when using the arm
> cross-compile toolchain I get the error: 
> 
> prelink: bin_arm/hello: Could not parse `/usr/local/sbin//prelink-rtld: error
> while loading shared libraries: ld-linux.so.3'

The error indicates that it found a library required called 'ld-linux.so.3', but
could not find that in the "path".  (The path generally being the sysroot path
passed to the rtld.)

What command did you use to run the prelinker?  And does your sysroot contain
the /lib/ld-linux.so.3?

--Mark

> If I understand it correctly then prelink-rtld emulates ld-linux.so but why is
> it parsed by rtld?
> 
> Here are my files:
> 
> # main.cpp
> 
> #include <stdio.h>
> #include "world.h"
> int main (int argc, char *argv[])
> {
> fprintf(stdout, "hello\n");
> World w;
> w.Str();
> return 0;
> }
> 
> 
> # world.cpp
> 
> #include "world.h"
> void World::Str()
> {
> fprintf(stdout, "world\n");
> }
> 
> 
> # prelink_arm.conf
> 
> -l arm-2012.03/arm-none-linux-gnueabi/libc/lib 
> -h arm-2012.03/arm-none-linux-gnueabi/libc/lib 
> -l arm-2012.03/arm-none-linux-gnueabi/libc/usr/lib
> -h arm-2012.03/arm-none-linux-gnueabi/libc/usr/lib
> 
> 
> # compiling
> 
> ../arm-2012.03/bin/arm-none-linux-gnueabi-gcc -Wall -fPIC -shared -Iinclude -o
> lib_arm/libworld.so src/world.cpp 
> arm-2012.03/bin/arm-none-linux-gnueabi-gcc -Wall -Iworld/include
> -Lworld/lib_arm/ -lworld -o bin_arm/hello src/main.cpp
> 
> 
> # prelink-cross
> 
> PATH=/usr/local/sbin prelink --verbose --cache-file=cache/prelink_arm.cache
> --config-file=prelink_arm.conf
> --ld-library-path="world/lib_arm;arm-2012.03/arm-none-linux-gnueabi/libc/lib;arm-2012.03/arm-none-linux-gnueabi/libc/usr/lib;"
> -h bin_arm/hello
> 
> 
> I am sort of stuck. Could you point me in the right direction. What am I missing
> or doing wrong?
> Thank you.
> 
> Cheers
> Florian
> 
> Ps. I have put together the code on github this would be the "shared-library"
> branch.
> https://github.com/fnbk/prelink-cross-example 
> 
> Ps. I posted a similar question on stackoverflow, cross-prelinking but without
> shared libraries.
> http://stackoverflow.com/q/30849060/5011904
> 
>  
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 




More information about the yocto mailing list