简体   繁体   中英

32-bit App with dynamic library crash on 64-bit device

I am facing the following scenario:

  • 32 bit device + app armv7 + dynamic library armv7 arm64 = work
  • 64 bit device + app armv7 + dynamic library armv7 arm64 = doesn't work

doesn't work - app crashes on load with the following error:

dyld error message library not loaded reason no suitable image found

Any explanations?

Explanation : 32 bit binaries loaded on 64 bit devices fail to do so since the 32 bit pagesize has been changed from 4096 bytes to 16384 bytes in iOS 9.

Conclusion : 32-bit apps with dynamic libraries cannot run on 64-bit devices.

Solutions (one of the two is enough):

  • Add a new entry to Other linker flags in the dynamic library project:

    -Wl,-segalign,4000

  • Update app itself to support arm64 architecture

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM