c - 使用 armcc 与前面的对象相反的字节顺序

标签 c linker fatal-error endianness armcc

我正在使用 armccarmlink 来编译和链接我的程序。编译源代码后,我试图用 armlink 命令链接它们,但我得到了这个错误:

fatal error :./Release/Source/BookCity/bookcity_Protocol.o 有相反的字节 对前面的对象进行排序。

这个错误是什么意思?如何更改 armcc 中的字节顺序?

这是我的链接命令:

armlink -bin -o ./cis-0.123.bin ../../Lib/X2API.alf ../../Lib/X2DeviceB.alf ../../Lib/X2Font。 alf ../../Lib/X2PPPTCP.alf ./Release/Source/BookCity/bookcity_Protocol.o ./Release/Source/BookCity/bookcity_configuration.o ./Release/Source/BookCity/bookcity_initialization.o ./Release/Source/BookCity/bookcity_transactions.o ./Release/Source/Cash/cash_configuration.o

最佳答案

看看你的数据初始化。来自“编写双端编译器”:

Data Initialization

In the BEC, pointer data types can also be attributed with a byte order. As a result, there may be situations where a pointer has the opposite byte order as the target platform. Pointers of the opposite byte order must be byte-swapped upon initialization. This presents a challenge when pointers are initialized by link time constants because these constants are unknown at compile time and are resolved later during the linking stage.

来源:http://www.drdobbs.com/architecture-and-design/writing-a-bi-endian-compiler/240003090

如果它没有解决您的问题,请考虑向编译器团队开发人员提交错误问题。这可能是内部错误。

关于c - 使用 armcc 与前面的对象相反的字节顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19512093/

相关文章:

c - 在C中使用安全打印功能

c - 在分段筛中将 int 更改为 unsigned long long 时性能大幅下降

linux - 使用 $ORIGIN 指定 ELF 二进制文件中的解释器不起作用

objective-c - 混合 Objective-C 和 Swift : fatal error: use of unimplemented initializer 'init(target:action:)' for class

快速 fatal error : unexpectedly found nil while unwrapping an Optional value in adMob

c - 如何在c中的字符串末尾插入NULL

c - FTP 服务器何时接受客户端的被动数据连接?

java - g++、ld 和 JNI - 链接问题

c++ - Borland C++ 链接器错误 c 文件包含

java - 为什么我在解析 xml 文件时遇到 fatal error ?