linker mylib.so has text relocations. This is wasting memory and is a security risk. Please fix.
1. add -static -fPIC to .a lib build compile flags 2. android so Android.mk LOCAL_CFLAGS += -shared -fPIC LOCAL_LDFLAGS += -shared -fPIC eu-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 option until suker@suker-Lenovo-Y430P:armeabi$ eu-findtextrel xx.so eu-findtextrel: no text relocations reported in 'xx.so' suker@suker-Lenovo-Y430P:armeabi$
本文介绍了解决Android开发中SO文件存在的内存浪费和安全风险问题的方法。通过调整编译选项,如添加-fPIC标志来确保共享库正确编译,避免了文本重定位错误,提升了应用的安全性和性能。

4701

被折叠的 条评论
为什么被折叠?



