Linking 32-bit library to 64-bit program

后端 未结 3 1770
天命终不由人
天命终不由人 2020-11-30 11:25

I have a 32-bit .so binary-only library and I have to generate 64-bit program that uses it. Is there a way to wrap or convert it, so it can be used with 64-bit program?

3条回答
  •  心在旅途
    2020-11-30 11:51

    It is possible, but not without some serious magic behind the scenes and you will not like the answer. Either emulate a 32 bit CPU (no I am not kidding) or switch the main process back to 32 bit. Emulating may be slow though.

    This is a proof of concept of the technique.

    Then keep a table of every memory access to and from the 32 bit library and keep them in sync. It is very hard to get to a theoretical completeness, but something workable should be pretty easy, but very tedious.

    In most cases, I believe two processes and then IPC between the two may actually be easiest, as suggested othwerwise.

提交回复
热议问题