1

我正在使用armccandarmlink来编译和链接我的程序。编译源代码后,我尝试将它们与armlink命令链接,但出现此错误:

Fatal error: ./Release/Source/BookCity/bookcity_Protocol.o has the opposite byte order to the preceding objects.

这个错误是什么意思?如何更改字节顺序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

4

1 回答 1

0

Take a look at your data initialization. From "Writing a Bi-Endian Compiler" :

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.

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

If it didn't solve your problem, think about submitting a bug issue to the compiler team dev. It's may be an internal bug.

于 2013-10-22T09:17:58.267 回答