« first day (2 days earlier)  last day (15 days later) » 

5:58 AM
@Janka Output is

ERROR: ld.so: object './libCP5200.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
linux-gate.so.1 => (0xf7fa4000)
./libCP5200.so (0xf7f82000)
libCP5200.so => not found
libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf7dee000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7dd1000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7c1a000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7bc5000)
/lib/ld-linux.so.2 (0xf7fa6000)
 
 
1 hour later…
7:17 AM
You are testing this on the x86 machine.
You have to ldd on the Raspberry.
 
Yes, same output on raspberry pi
connected it via VNC so
@janka here's my libray architecture
file libCP5200.so
libCP5200.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, not stripped
Output of LD_PRELOAD=./libCP5200.so ldd ./test in raspberry is
ERROR: ld.so: object './libCP5200.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object './libCP5200.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
linux-vdso.so.1 (0x7e944000)
/usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76fbe000)
libCP5200.so => not found
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76ecc000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76e51000)
libgcc_s.so.1 => /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x76e24000)
 
7:37 AM
Here you have another problem, ./libCP5200 isn't in the current directory when you call ldd ./test.
 
@janka no, it is in the present directory. Really stuck bad in this :(
 
Then try with an absolute path, please.
 
Same output :
LD_PRELOAD=/home/pi/Downloads/linux-sdk-demo-arm ldd ./test
ERROR: ld.so: object '/home/pi/Downloads/linux-sdk-demo-arm' from LD_PRELOAD cannot be preloaded (cannot read file data): ignored.
ERROR: ld.so: object '/home/pi/Downloads/linux-sdk-demo-arm' from LD_PRELOAD cannot be preloaded (cannot read file data): ignored.
linux-vdso.so.1 (0x7ee69000)
/usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76f07000)
libCP5200.so => not found
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76e15000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76d9a000)
 
No, this is a very different error.
"cannot read file data"
Because this is a directory, not the absolute path to your libCP5200.so
 
so i need to change anything in command ?
or it is architecture problem in .so file ?
 
7:42 AM
LD_PRELOAD=/path/to/my/libCP5200.so ldd ./test
 
ERROR: ld.so: object '/home/pi/Downloads/linux-sdk-demo-arm/libCP5200.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object '/home/pi/Downloads/linux-sdk-demo-arm/libCP5200.so' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored.
linux-vdso.so.1 (0x7efa5000)
/usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76f1c000)
libCP5200.so => not found
libstdc++.so.6 => /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x76e2a000)
libm.so.6 => /lib/arm-linux-gnueabihf/libm.so.6 (0x76daf000)
 
Now it's "cannot open shared object file"
You have to check if that file really is at that location, and the correct one.
file /home/pi/Downloads/linux-sdk-demo-arm/libCP5200.so
 
Yes, it is in this path
pi@raspberrypi:~/Downloads/linux-sdk-demo-arm $ file /home/pi/Downloads/linux-sdk-demo-arm/libCP5200.so
/home/pi/Downloads/linux-sdk-demo-arm/libCP5200.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, not stripped
 
Is it executable?
 
yes, tried with all permissions
currenty its having 777 ( -rwxrwxrwx )
 
7:48 AM
ldd /home/pi/Downloads/linux-sdk-demo-arm/libCP5200.so
 
pi@raspberrypi:~/Downloads/linux-sdk-demo-arm $ ldd /home/pi/Downloads/linux-sdk-demo-arm/libCP5200.so
not a dynamic executable
 
AAAAAAhhhhhh
 
it will not run in this pi architecture ?
 
No, this is a statically linked library.
 
any possible chances @janka ? :(
it runs on x86 with x86 compiled .so
 
7:52 AM
It should work on the ARM, too.
 
i am making API call from this library
 
I'm a bit lost, because LD_PRELOAD should bypass all the system's library configuration.
 
i am comfortable with sharing my source code if you want
 
I don't have time for so much testing.
 
okay fine. :) i'm also lost , why is this not working
thank you so much for the help @Janka . Really appreciate for giving your timing
 

« first day (2 days earlier)  last day (15 days later) »