has text relocations

来源:互联网 发布:retrofit 传json 编辑:程序博客网 时间:2024/05/01 08:20

原文:http://www.itdadao.com/articles/c15a324479p0.html


在Android6.0+系统,app编译时TargetAPI>22时,加载一些so出现has text relocations的问题处理方法:

在linux系统下使用eu-findtextrel命令可以查看问题所在地方,如下:

1. add -static -fPIC to .a lib build compile flags2. android so Android.mkLOCAL_CFLAGS += -shared -fPICLOCAL_LDFLAGS += -shared -fPICeu-findtextrel xx.so suker@suker-Lenovo-Y430P:armeabi$ eu-findtextrel xx.so either the file containing the function 'xxx_arm' or the file containing the function '__cxa_thread_atexit' is not compiled with -fpic/-fPIC...fixed build optionuntilsuker@suker-Lenovo-Y430P:armeabi$ eu-findtextrel xx.so eu-findtextrel: no text relocations reported in 'xx.so'suker@suker-Lenovo-Y430P:armeabi$ 

原创粉丝点击