重定位值不适合24位

重定位值不适合24位

本文介绍了重定位值不适合24位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用vxWorks函数loadModule将代码文件加载到内存中,这给了我错误:

I tried to load a code file to memory using the vxWorks function loadModule and it gave me the error:

Relocation value does not fit in 24 bits

我试图在编译器中添加-mlongcall标志,但是它不起作用.

I tried to add the -mlongcall flag in my compiler but it doesn't work.

推荐答案

如果要使用 -mlongcall ,请确保针对 Active Build Spec 将编译器设置为GNU.强>.请记住,WindRiver还提供了Diab编译器,而恰好是它们的专有编译器.如果要使用Diab编译器,则该编译器的等效标志为:

Be sure that your compiler is set to GNU for your Active Build Spec if you want to use -mlongcall. Remember that WindRiver also provides the Diab compiler, which happens to be their proprietary compiler. If you want to use the Diab compiler the equivalent flag for that compiler is:

-Xcode-absolute-far

如果您使用的是Workbench,则可以通过右键单击Project Explorer子窗口中的项目,然后选择

If you are using Workbench, you can see what compiler you are using (and possibly change it if you so desire) by right clicking on your project in the Project Explorer sub-window then select

属性-> 构建属性-> 构建支持和规格.

在该对话框中,您将(通常在底部)看到一个名为 Active Build Spec 的下拉菜单按钮.选择所需的架构编译器组合.

In that dialog you will see (usually at the bottom) a drop-down menu button named Active Build Spec. Select the architecture-compiler combination that you desire.

如果找不到所需的体系结构-编译器组合,则很可能在创建项目时未选择它,或者您购买的pkg VxWorks没有随附该组合.

If you don't find the architecture-compiler combination that you require, you most likely did not select it when you were creating the project OR it did not come with your purchased pkg of VxWorks.

这篇关于重定位值不适合24位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 05:50