Hi guys
I was also struggling to run dynamically linked binaries in the recovery context. The following command was also returning the dynamic linker location to /system/bin/linker
readelf -d --program-headers myandroidbinary
And I did not want to hex edit the binary to change it. Instead, I placed the linker in /sbin/linker and then in the init.recovery.rc script I added:
on init
...
# Path for shared libraries in the recovery context
export LD_LIBRARY_PATH /sbin/lib
# Add a symlink to the Android dynamic linker as some binaries call it from /system/bin
symlink /sbin/linker /system/bin/linker
Make sure to create the /system/bin path in the Makefile so that the symbolic link that init creates can live in there.
And regarding the SO libraries, I copied them to /sbin/lib and then added some make commands to the /build/core/Makefile so that they were copied into the recovery image.
By doing this you can have logcat and any other dynamically linked binaries running in the recovery context.
Thanks Rudolf.