Android 之 text relocations的简单解决方法

Android 6.0系统上遇到native lib异常:AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: /system/lib/libcoupon.so: has text relocations导致程序崩溃,

简单解决办法:在mk脚本中, 对LOCAL_CFLAGS, 增加-fPIC参数, 同时按需求配置链接库的参数. 此方案的参考源是这里.(简单但会影响程序效率)

 

副一篇官方的解决方案(但是比较复杂):https://wiki.gentoo.org/wiki/Hardened/Textrels_Guide

posted @ 2015-11-09 18:37  神奇的洋葱  阅读(2611)  评论(0编辑  收藏  举报