illegal text-relocation错误解决

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shengpeng3344/article/details/52998224

出现下列类似问题

这里写图片描述

这个问题一般还是底层库lib的编译有问题,需要解决的同志还需要和底层同事协商解决

设置Build Settting ->Other linker flag 为 -read_only_relocs suppress

这里写图片描述

当然,这只能强制忽略错误,错误还是在的

有兴趣的可以查下other linker flags 的各种命令含义,

-read_only_relocs suppress 意思就是relocs(重定位) suppress(压制) ,不显示重定位错误

如果需要解决,那么armv7上32位的编译问题,上述的other linker就不要改了!!!!,使用下面

尝试修改xcode中的Generate Position-Dependent Code项

这里写图片描述

如果不能解决问题,修改Build Settings中的Strip style

这里写图片描述

将其置为Non-Global Symbols 。

如果不行的话多试下,All symbols是工程默认,动态库默认为DeBugging Symbols,意思是symbols需要加载以使用Debug模式下的各种错误日志信息,以及定位信息

官方文档中对Strip Style的描述:

Defines the level of symbol stripping to be performed on the linked product of the build. The default value is defined by the target’s product type. [STRIP_STYLE]

All Symbols - Completely strips the binary, removing the symbol table and relocation information. [all, -s]

Non-Global Symbols - Strips non-global symbols, but saves external symbols. [non-global, -x]

Debugging Symbols - Strips debugging symbols, but saves local and global symbols. [debugging, -S]

这个问题一般还是底层库lib的编译有问题,需要解决的同志还需要和底层同事协商解决

猜你喜欢

转载自blog.csdn.net/shengpeng3344/article/details/52998224
今日推荐