after upx compress x.so
, dlopen failed on Android platform, got errmsg: .dynamic section has invalid offset: 0x5d0e8, expected to match PT_DYNAMIC offset: 0x5c0e8.
Host:
Darwin MacBook-Pro.local 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 x86_64
toolchain:
↳ clang --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin21.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
full logcat:
06-30 17:11:30.069 20964 20964 E linker : "/data/app/~~3Eg385x6bBDS_xLiQSmxYQ==/com.upxverify.sample-sncx9KpQqEMVGxWWQMjvZQ==/base.apk!/lib/arm64-v8a/libtest.so" .dynamic section has invalid offset: 0x5d0e8, expected to match PT_DYNAMIC offset: 0x5c0e8
06-30 17:11:30.069 20964 20964 D AndroidRuntime: Shutting down VM
--------- beginning of crash
06-30 17:11:30.069 20964 20964 E AndroidRuntime: FATAL EXCEPTION: main
06-30 17:11:30.069 20964 20964 E AndroidRuntime: Process: com.upxverify.sample, PID: 20964
06-30 17:11:30.069 20964 20964 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/~~3Eg385x6bBDS_xLiQSmxYQ==/com.upxverify.sample-sncx9KpQqEMVGxWWQMjvZQ==/base.apk!/lib/arm64-v8a/libtest.so" .dynamic section has invalid offset: 0x5d0e8, expected to match PT_DYNAMIC offset: 0x5c0e8
06-30 17:11:30.069 20964 20964 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:1077)
06-30 17:11:30.069 20964 20964 E AndroidRuntime: at java.lang.Runtime.loadLibrary0(Runtime.java:998)
06-30 17:11:30.069 20964 20964 E AndroidRuntime: at java.lang.System.loadLibrary(System.java:1661)
I tried upx v4.0.0、v4.0.2, compress failed, errmsg was segment fault
;
and I tried ndk version 21.4.7075529 and 25.2.9519653 with upx@4.0.1, got the same error dlopen failed
.