NixOS / patchelf

A small utility to modify the dynamic linker and RPATH of ELF executables
GNU General Public License v3.0
3.57k stars 487 forks source link

java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH in "libxxx.so" #480

Closed peterRedtea closed 1 year ago

peterRedtea commented 1 year ago

Describe the bug Run the command with a so library named libtest.so for android arm32 device:

patchelf --add-needed libdep.so libtest.so

then put the so library into the android project, and build a app to run in the Android 5.1 armeabi-v7a device**, throw a exception:

java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH in "libtest.so" (built with --hash-style=gnu?)

Expected behavior

Work fine without exception in Android5.1 device.

patchelf --version output 0.16.1 && 0.17.2 The above two versions have this problem.

brenoguim commented 1 year ago

Can you attach the library before and after patchelf, together with the patchelf command you executed? If not, can you post the result of readelf -a -W yourlib.so before and after patchelf? That really helps debuggigng. Thanks!

peterRedtea commented 1 year ago

Can you attach the library before and after patchelf, together with the patchelf command you executed? If not, can you post the result of readelf -a -W yourlib.so before and after patchelf? That really helps debuggigng. Thanks!

I'm so sorry, because the library is private, I cannot provide the content by the command.

Mic92 commented 1 year ago

Than we are sorry because we cannot help you in this case.