android 禁用dlsym_dlopen()不能与android-n一起使用

dlopen()不返回指向某个soinfo结构的指针,它返回void *,标准的Linux手册页对此非常具体:

The function dlopen() loads the dynamic shared object (shared library) file named by the null-terminated string filename and returns an opaque “handle” for the loaded object. This handle is employed with other functions in the dlopen API, such as dlsym(3), dladdr(3), dlinfo(3), and dlclose().

因此,您可以以某种方式解释返回值的事实是非标准的,现在Google只是使用this change强制执行:

commit ae74e8750b9dae51b24a22fdb4b0e0a2d84f37b9

author Dimitry Ivanov

...

linker: hide the pointer to soinfo

Handle no longer is a pointer to soinfo of

a corresponding library. This is done to

prevent access to linker internal fields.

Bug: http://b/25593965

Change-Id: I62bff0d0e5b2dc842e6bf0babb30fcc4c000be24

(cherry picked from commit d88e1f350111b3dfd71c6492321f0503cb5540db)

因此,除非您的应用程序针对的是SDK版本23或更低版本(请参阅soinfo :: to_handle()),否则您现在获得的句柄只能通过内部仿生soinfo_from_handle()转换回soinfo *.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值